How to apply an Impulse Force

I want to make the player’s character be able to jump in the air multiple times like how the bird in Flappy Bird does.

I wanted to use an impulse force to achieve this so it looks smooth, but the player isn’t moving at all when I press space.

This is the ServerScript, it definitely works because the print statement is on the output.

FlapRmt.OnServerEvent:Connect(function(plr)
	local Character = plr.Character
	local hum = Character:FindFirstChild("Humanoid")
	local humRP = Character:FindFirstChild("HumanoidRootPart")
	
	local ForceMulti = 1000
	humRP:ApplyImpulse(humRP.CFrame.LookVector * ForceMulti + Vector3.new(0, 10, 0))
	
	print("force")
end)

I’ve tried using bodyForce, but it doesn’t have the right feel since it slows the player down midair before they drop.
I’m currently using ApplyImpulse but the player doesn’t move.

Vid of using ApplyImpulse

The NetworkOwner of a character is its player, meaning you can only use ApplyImpulse on the client of the player. Try doing exactly what you are doing right now, just in a LocalScript. If you think this is insecure, note that WalkSpeed is also controlled by the client, making it just as insecure. Necessary safeguards on the server are recommended!

7 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.