How would i make a movement system like this?

Hi, so i want to create a movement sysem like balthazar but no idea how it works, could someone explain in detail?

1 Like

Currently revamping a similar system myself for my own project, I can give you some base explanation on how this is implemented. (Base explanation because there is more than one way to accomplish this same type of system.)

You’re able to implement the directional movement with the use of Humanoid.MoveDirection, which is a property that tells you the current direction said humanoid is moving in. Though, the downside with this data is it’s converted in world space, which isn’t correlating to the humanoid root’s current orientation for the best accuracy. For you to orientate it into object’s space, (the root’s orientation) you just use the CFrame of the root part to rotate the move direction into the object’s space like so.

local Humanoid = char:WaitForChild("Humanoid")
local RootPart = char:WaitForChild("HumanoidRootPart")

local moveDir = RootPart.CFrame:VectorToObjectSpace(Humanoid.MoveDirection)

And afterward, you would just use X and Z values to determine what animation to play at that current time. (If you don’t know already, positive X and positive Z is the same as saying Right and Forward. Negative means the opposite.)

Now to actually code this, you might have to rewrite the entire Animate script since I would say it’s easier to create something from scratch. But, if you think it’s easier to fork Roblox’s default Animate script, you can do that as well.

Hopefully this helps puts you in the right direction. : )

P.S.: I completely forgot to address the rotation aspect of the system.

You could use AlignOrientation to make a smooth rotation of the humanoid. Though, you should also disable the AutoRotate property on the humanoid as well. Make sure the first attachment is set to the RootPart’s one and only attachment. (RootAttachment)

A way you could totally do this is by using RunService and have the AlignOrientation set it’s CFrame to the direction of the camera and just removing the camera’s vertical and roll rotation axis. (IIRC, it’s the X and Z orientations for the camera “AnglesYXZ”) For this to work though, the AlignOrientation should have OneAttachment on. The downside of this though is, I believe it’s costly in performance due to it setting the CFrame at every possible frame. You can better do this by just listening to when the Camera’s CFrame property has changed.

I’m sure there’s another way you can do this too without the need of a property changed listener or a RunService. I’m trying to find that myself, I’ll update it once I find new resources. ^^

1 Like

Thank you a lot, i’ll try it and let you know.

1 Like