Hello guys.
I don’t know how to correctly set the 4 enemy animations (down, Up, Left and Right). Can someone explain?
Adds a picture like I tried to do, the animation works as long as there is only y, when I add x it stops working
Hello guys.
I don’t know how to correctly set the 4 enemy animations (down, Up, Left and Right). Can someone explain?
Adds a picture like I tried to do, the animation works as long as there is only y, when I add x it stops working
Your issue is because if you set the animation based on Y position first, then based on X position, the X position animation change will overwrite the Y position animation change.
Instead, you can check which of the X or & position difference is the smallest, and change animation in that direction. Something like:
(here abs
stands from absolute value, which removes any negative/minus sign from a number)