Velocity in relation to a part's orientation

Howdy. I’m trying to create an animation system that plays different walking animations based on the direction the player is moving, in relation to the direction that their character is facing. For example, if a character walks in the direction they’re facing, a forward walking animation will be played, but when they start walking sideways or backward (while still facing the same direction), the animation will change to reflect this.

I’m trying to implement this based on the player’s movement in relation to the orientation of their HumanoidRootPart. Is there a simple way to check an object’s velocity relative to its LookVector?

1 Like

You can use To object space or VectorToObjectSpace with the humanoid root part CFrame and velocity.

The X and Z will become relative like X=1 or more means a strafing right movement.

1 Like

Damn, thanks a ton. I had no clue that was a thing, but I just looked up and it was honestly way simpler than I’d expected. I’m not sure how I missed it before but thanks for informing me

1 Like