How can I obtain the exact direction of a player's movement when the player's speed is 0

Im making a Climb System.Player can move on the wall.
But when a player is climbing.His speed will be set to 0.So i can only use Humanoid.Movedirection(I dont know if there are other ways to know player speed when speed = 0) to get player’s movedirection.
So i have to Convert Player’s movedirection to Player’s movedirection on the wall.I tried many way but i failed and i found that when i rotate my camera the movedirection will be changed.
Anyone know how can i make it?

Use the humanoidRootParts LookVector or smth?

A potential solution is to constantly keep track of the direction they’re moving in. If it’s 0 then don’t update it.

E.g

local LastDirection = Vector3.zero

Humanoid.Running:Connect(function() -- Some event or loop to keep track
    local Direction = Humanoid.MoveDirection
    LastDirection = if Direction.Magnitude == 0 then LastDirection else Direction
end)


1 Like

it depends on if the system is handled on a localscript.
if so then you can get the actual direction the player is moving in by requiring their PlayerModule
and using the camera’s cframe

such as this

require(game.Players.LocalPlayer.PlayerScripts.PlayerModule):GetControls().Direction

also check out this post