How can I do the Pathfinding correct animation?


#1

How can I make enemies with Pathfinding behavior show the correct animation according to their angle of rotation or displacement in 8 directions?
I tried these options but they don’t work.

even added behavior 8 movements and it doesn’t work.
Of course I am grateful for all help.
Sorry for my English XD


Rotation of the pathfinding objects In correlation with animation rotation
How can I change the animations/ sprites of a pathfinding object
#2

Take a look on Isometric example, the character Minda use Top-Down Movement (4 or 8 directions)


#3

Unfortunately The problem with the Minda example is that MINDA obeys the actions of the mouse or keyboard. In my case if the enemy applied a default control effectively changes the animation …

But if I only apply Pathfinding behavior to the enemy, the enemy persecutes me but does not change his animation even with events.

I don’t know if there is another alternative to Pathfinding behavior for the enemy to chase me and change their animations according to their angle.


#5

Finally after much trial and error.:alegría: I achieved a solution to the change of animation according to the angle of rotation of an enemy with Pathfinding behavior. Here my solution. If you have any other way please tell me.


#6

Hello Hoar, how are you?
I’m having the same trouble. How did you solve it? did you find another easiest way?:grimacing:


#7

I put here 2 more photos that worked for me. Even so, I think there can be multiple solutions.


#8

Thanks for your reply, maybe i will try to do like this. I tried but i couldnt do it, maybe im doing something wrong. I will do it again later and i will tell you if it goes for me: :grinning:


#9

http://www.mediafire.com/file/rbxscxghxq5u4ev/My_project21.rar/file

Here my events and I hope it helps you. If you want you can also apply animation and diagonal movements to the enemy.


#10

Thanks a lot for this example!!! it will helps me. I will try to do with diagonals. Thanks for your reply and your time!!:grinning::grinning:


#11

I found another solution that i find simpler, since all that math stuff makes no sense to me. I have a hidden object following my moving character. The hidden object has rotation enabled. That allows me to get an angle while the object is moving without having my visible object rotating. Instead my visible object gets the correlating animation number.