I’m trying to find the MoveDirection for y axis which I presume to be going up and down right?
But, when looking into “Humanoid”, all I notice is X and Z changing when moving side to side, forwards and backwards, but not Y when I try jumping or moving myself 1000 studs into the air and falling down.
Whats the MoveDirection for Y Axis for if you don’t go up or down?
EDIT: If you don’t know why I’m trying to find the Y Axis, refer to this post: Smooth Movement on Character?
Or in a nutshell, trying to apply movedirection on a slope for smooth movement going up and down with BodyForce. If theres any easier way to do this though rather than this, just tell me
Shouldn’t measuring the Velocity property work? If memory serves me right, the Velocity property on the HumanoidRootPart / Torso changes if you jump or fall. The thing is, if an outside force comes along, Velocity will change, too.
Internally the Humanoid only sets the Y component of MoveDirection when in the swimming state, it’s not used for jumping at all, jumping is specially-cased and separate from the normal walk/run/swim movement vector, that’s why you don’t see it changing. If you swim up and down, you should see it have a value, IIRC. Maybe not. I can’t remember if this is reflected in what is exposed to Lua.
Wait, so referring to the “Smooth Movement on Character?” Post, when he said to " project Humanoid.MoveDirection onto that surface’s normal plane, then move in that direction." Should I just add BodyForce that has Y automatically be set for Z and X and that would allow for smooth movement?
Projecting the MoveDirection will work well for getting the direction on the surface if it’s not too close to vertical. How you scale the force in that direction depends on the effect you want, like how much you want gravity to play a role. Adding a Y component to counter gravity probably will be smoother than just increasing the XZ force to compensate, but I haven’t done this comparison.