How to prevent the character from moving when it falls?

So I had this problem that I still can’t solve (actually I did it using RunService, but it’s too complicated) and the suggestions I was given didn’t work in my case, so I decided to move on to another problem.

When our character falls from a very high position, we can still move it forward, backward and sideways, reaching the ground in a different position. How can I make the character not to move while falling and when it reaches the ground it will be in the same position in X and Z as when it started to fall?

You can set the movement speed of the player to 0 while the player is falling.

Example (Script inside of StarterCharacterScripts)

local char = script.Parent
local human = char.Humanoid

human.StateChanged:Connect(function(prevState, newState)
    if newState == Enum.HumanoidStateType.Freefall then
        human.WalkSpeed = 0
    elseif newState == Enum.HumanoidStateType.Landed then
        human.WalkSpeed = 16 
    end
end)
2 Likes

thanks. that was valuable. _____________________________