How do I stop moving objects from 'moonwalking'? Animation doesn't match the movement direction

0 favourites
  • 2 posts
From the Asset Store
Rotate & Animation for 16 Direction & Mouse Direction
  • So, I'm using MoveTo behavior on a family of instanced objects ('mobs'). I make them move to a random point.

    + System: Every 0.02 seconds + System: Pick a random mobs instance -> mobs: MoveTo: Move to (mobs.X + int(random(-48,48)), mobs.Y + int(random(-48,48))) (Direct)

    Thanks to MoveTo, their moving angle can be referenced. I use that with System 'Is between angles' and then angles to represent up, down, left, right.

    + System: For each mobs + mobs: MoveTo is moving + System: Every tick ----+ System: mobs.MoveTo.MovingAngle is between 315 and 45 degrees -----> mobs: Set animation to "walkUp" (play from beginning) ----+ System: Else ----+ System: mobs.MoveTo.MovingAngle is between 45 and 135 degrees -----> mobs: Set animation to "walkRight" (play from beginning) ----+ System: Else ----+ System: mobs.MoveTo.MovingAngle is between 135 and 225 degrees -----> mobs: Set animation to "walkDown" (play from beginning) ----+ System: Else ----+ System: mobs.MoveTo.MovingAngle is between 225 and 315 degrees -----> mobs: Set animation to "walkLeft" (play from beginning)

    The problem is that it many of the objects will 'moonwalk' in that the animation doesn't update to the direction (angle) they're currently walking. So, they could be walking left but still using the walkRight animation. Any idea how to fix it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I should also mention that I've tried it with various rotation speeds. The 'rotate' option of MoveTo and Pathfinding are both turned off, because they both keep track of moving angle regardless of that.

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