3D lock-on directional movement animations

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DiAlEx

I’m using a state machine on a kinematic body and have set up a state that locks on to an enemy and allows the player to move while always facing the enemy. But now I want the player model to play different animations based on how its moving. Like strafe left if its moving to the body’s local left direction, forward if it’s moving towards the enemy, etc.

:bust_in_silhouette: Reply From: Ertain

Have you looked into a BlendSpace2D node? One axis can be designated for the x-axis while the other axis can be used for the z-axis. When the vectors for the player’s input go to a certain range, the animation will change for that range.

unortunately I can’t use input here. I am using a fixed camera system so the the animations have to depend on the body’s directional movement

DiAlEx | 2023-05-27 21:18

Then instead feed the direction of the body to the BlendSpace2D. Or am I missing something here?

Ertain | 2023-05-28 04:39