Changing sprite animation based on top-down pathfinding movement

0 favourites
  • 2 posts
From the Asset Store
3D Car Pack 1
$1.80 USD
40% off
3D models + Rendered Low-Poly Cars in isometric, top-down, and side angles.
  • I'm working on a top-down game with moving NPC sprites, and I'd like to use different animations based on their direction of movement. They all have 8-direction behaviour, but the only way I can see to change animations based on direction, is with keyboard input. However, these aren't player characters.

    I've found the "8-Direction -> Is Moving" condition, but no conditions or actions relating to direction of travel.

    I've tried doing it by object angle, but the object doesn't have rotation enabled. I also tried adding an invisible pinned sprite and rotating that, but I still can't find any conditions that would enable rotation based on direction of travel

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, so I found the Moving Angle and CurrentNode expression for the Pathfinding behaviour, and have changed the sprite to rotate towards the CurrentNode it's walking towards.

    However, I tried to change the animation based on angle, but I don't understand how the angles are decided. Is it relative to the node (with straight forward being 0 degrees), or is there a 'global angle' based on the layout that I can use?

    This is what I have now, and the animations are all over the place during Preview

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