Making player unable to move when jumping?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Making player unable to move when jumping and keep it’s velocity moving

  2. What is the issue? I don’t know how to do it

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?Yes

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

1 Like

Try this:

local char = script.Parent
local humanoid = char:WaitForChild("Humanoid")

humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
	humanoid.WalkSpeed = 0
	wait(.5)
	humanoid.WalkSpeed = 16
end)

Put it into StarterCharacterScripts

1 Like

CoR Rewrite #4 - Roblox like the jumping of this game

i recommended using the free fall state than using the jump state as a trigger

cuz once the player is falling they will still able to move cuz it didnt trigger the jump state

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()

local Humanoid = Character:WaitForChild("Humanoid")

Humanoid.StateChanged:Connect(function(OldState, NewState)
	if NewState == Enum.HumanoidStateType.Freefall then
		Humanoid.WalkSpeed = 0
	elseif NewState == Enum.HumanoidStateType.Landed then
		Humanoid.WalkSpeed = game.StarterPlayer.CharacterWalkSpeed
	end
end)

i know how to make the player stop moving when jumping

Try checking: ContextActionService
Idea: Maybe when u jump, unbind all moving actions (WASD), and once the character finished jumping you bind them all again

preserving the velocity when jumping

Maybe u can put a force when the player presses the jump button, and put the player walkspeed to 0