Animation on pathfinding 8 directions

0 favourites
  • 6 posts
From the Asset Store
Hand-animated Sprite Base for isometric game/animation development
  • Good morning,

    I have an npc with pathfinding and what I would like is to add animations for the 4 directions which I am missing.

    Currently I have the 4 basic directions up, down, right, left which works well and I would like added the remaining 4: up to the left, up to the right, down to the left and finally down to the right

    If anyone has an answer or advice I'm interested, thank you!

  • my actual animations

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I think you have the right idea, you just need to add the 4 extra animations for the diagonals. So instead of within 45° you'd do within 22.5°

    22.5° within 0 = right

    22.5° within 45 = down right

    22.5° within 90 = down

    22.5° within 135 = down left

    22.5° within 180 = left

    22.5° within 225 = left up

    22.5° within 270 = up

    22.5° within 315 = up right

  • Thank you for your answer,

    I modified the angles by 22.5 as you advised me and I can see an improvement. The 4 directions already present still work and the directions up to the right and down to the right work.

    But I have a problem with the directions up to the left and down to the left with the debug page I could see that it doesn't even modify the animation so I guess it doesn't happen not able to detect the angles that I gave it for these two directions.

    I tried other values ​​but nothing worked, am I wrong somewhere? here the capture

  • You have a typo for this line. Should be 135 but you have 130.

    22.5° within 135 = down left

    If that doesn't fix it... not sure. Hard to tell from just the screenshots.

  • Yeah that was just a test but i have 135 before this capture.

    here my project maybe can help more to understand what i want to do :

    drive.google.com/file/d/1DrJFEZ-Q-AlDgog7JLNaw6uYscjOtHT0/view

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)