How do I make realistic walking?

I’m wondering how to achieve a walking animation that changes when you walk in a direction with shift lock. Like sidestepping or walking backwards. Here’s an example:


I know there is a post just about this but I want to achieve this effect with Humanoid.MoveDirection. I don’t plan on using inverse kinematics since it’s not needed for my project.
I want to know how to see directions like left, right, diagonal upright and etc. Please do not explain how Humanoid.MoveDirection works, I know how to use it just having trouble with it.

Use CFrames to make the movement direction relative to how the character is facing like this.

But how would I know what direction they’re moving in? It only knows where they’re moving.

Good question, this is a bit more advanced though you can notice some patterns like when walking forward Z is equal to -1 when it is in object space, backwards is equal to Z =1, right is X = 1.

You could even convert it into an angle by using:

local x, y, z CFrame.lookAt(Vector3.new(0,0,0), movementDirectionRelativeToHumanoidRootPart):ToOrientation()

–>Create a cframe looking towards the movement direction
→ Convert it into orientation for angle terms

You can do something like @i_eetANts which also uses the idea of getting a movement vector relative to the humanoid root part and then rounding it to the closest movement direction with an animation assigned like walk forwards, walk right and convert it into a hash/string identifier.

The result looks pretty good similar to Inverse kinematics which is interesting.

1 Like

Could you make an example script of this? How would I incorporate it.

Sorry for the bump, but you should really focus on following the actual forum that you took from in the first place: How do i make Realistic Walking/Running?

No reason to recreate the same thing again as the answer is in there. You can also use the examples @dthecoolest gave you.