So, I have an Enemy that move in a certain direction and I need to play a different animation for each direction.
Question: How can I know in which direction the Enemy is moving?
So, I have an Enemy that move in a certain direction and I need to play a different animation for each direction.
Question: How can I know in which direction the Enemy is moving?
maybe you could use blendtrees Unity - Manual: 2D Blending
yeah but my enemy uses Pathfinding so i need to know the direction the enemy is moving.
i think velocity worked for that, i used it to draw moving direction at least:
*or to get direction from next position
something like
var dir = (agent.nextPosition-transform.position).normalized;
CharacterController can do all of this, I think you use magnitude squared to do it.