Give back again directions in animations, Pathfinding 8 direction-angle animation

Hello everybody, i’m bit new here and i’m having a little big trouble. I want to make an enemy to walk with pathfinding (i’m not using it or moving with keys) looking it from the side (isometric game) but i can’t change the animation of my enemy according direction (or angle) of walk while he is moving with pathfinding. I try and try so hard and i can’t automatic change the animation according to the angle of movement of the enemy along the pathfinding.
The up-down movement is for character that is controlled and it isn’t for pathfinding movements, so the isometric example is not useful to this.
I was searching on the forum and also tutorials and the examples and there is nothing explaining that. I saw that there is an example with older version of gdevelop,

Pathfinding animation with older version of gdevelop

but the example was made with an older version of gdevelop and those options aren’t on latest version (i only can do add images to a specific number of animation but i can’t add to a specific number of animation diferentes images according to the angle).
I tried to use CONDITION: common for all objets–>movement—>angle of movement…etc and X angle
ACTION: Sprites—>animations and images–>change the current animation…x animation
Nothing is happening, even if i change angle of the sprite.
I saw others questions like this but none of those really solved. One of those was solved with ray emission but i couldn’t do it and i think there is a easiest way to solve something so basic like this. Please i NEED someone to solve these and if is with screenshot and images i will appreciate it so much, because i start to think about decline to make a game for this issue.
THANKS AND SORRY FOR MY BAD ENGLISH :grin:

2 Likes

This one really needs an answer. Tryed all kinds of stuff and workarounds, with no result :frowning:

A special box sprite with pathfinding for which goes enemy with difference coordinates.
But as I see then, too, the problem will arise.
How to make a sprite with pathfinding attach to a lot of enemies moved each for his.
SFMB English.

My way to make it was:

  • Using an object variable named Direction. I set Player.Variable(Direction)=round(Player.Angle()/90). This way Direction will get a value of: -1,0,1 or 2. (-1 being up, 0 right, 1 down and 2 left)
  • Change the animation of the Object to “Walking”+ToString(Player.Variable(Direction)), and having each animation named “Walking-1”, “Walking0”, “Walking1” and “Walking2”.
    +If 8 directions are needed you can divide by 45 and use -2,-1,0,1,2,3,4,5 for the animation names.

Not the most intuitive nor simple way to do it, but it works.

While I appreciate you sharing your knowledge and solution, in the future consider making a new thread instead of bumping a 2 year old thread.

Thank you again for posting your method!