How to change animation with pathfinding

like i said in the tittle
i want to make the animation change depending on if a charcter is going left or right when pathfinding

My be this youtube tutorial can help you:

Or this : https://www.youtube.com/watch?v=ueNsqs0Uxbc

no no, you dont controll the charcter, its controlled by ai

You can use compare 2 numbers and use an expression to compare the angle of the pathfinding movement.

-OR-
    Character.Pathfinding::MovementAngle()  > 270 | Change animation to Right
    Character.Pathfinding::MovementAngle() < 90   |

Character.Pathfinding::MovementAngle()  < 270 | Change animation to Left
Character.Pathfinding::MovementAngle() > 90   |

this mean ai follow player?

how do i do that? T-T

I told you how in these 2 events.

Here’s a screenshot of the events:

You may want to use flip object instead of changing animations, but in any case, this is how to check if the object is facing left or right.

1 Like

Buenos dias muchacho

If you want go beyond that
For how many more directions you want
image

Just keep in mind tolerance works both ways
So angle of 90° and tolerance of 15 will check range of 75° to 105°
Cause 15 gets added and subtracted to/from 90
That’s how tolerance works
So angle of 7 with tolerance of 32 will result in range from -25° to 39°

Now that you get the idea PAY CLOSE ATTENTION
In my 1st screenshot you have angle of movement
BUT LOOK AT ICON it is pathfinding
And it is VERY important cause there is exact same condition for forces
So do not pick wrong one and get confused why it don’t work

Adios muchacho

This game contains an extension that could help: