0 Favourites

How do I get my enemy to change its animation when moving

  • I'm currently trying to have an enemy follow my player when within a certain distance setting its direction based on its location compared the the players location which works fine the only problem is the animation the sprite changes animation when moving up or down but not when left or right even though its following the same set up any ideas on what the problem is and how I can fix it? I wish I could post a .capx but I can't

  • Probably the common issue of animations overriding where it's Y is always greater or less so it plays that animation and the left to right animations get overriden. Impossible to tell without any posted events though.

  • I think that must be the problem it plays the left/right animation when I set to do so when moving up and down but then wont play the up/down animation when set to moving left and right, so whatever animation is set to play while moving up and down must be overriding the left and right animation is there anyway to change that

  • What are you using to move it, MoveTo? Pathfinding? 8-direction behaviour? use these to predict what animation to play, not its difference on x,y from the player. If simulating right or angle is 0 then play right etc.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Its using the 8-direction and its to move towards the player based on the X Y position which works perfect and the I have it set to play the different animation based on what angle its moving so if its moving is say 90 it plays the down animation if its -90 it plays the upward animation which works perfectly fine its also set to play the left/right animation when moving at a 0/180 angle but that does not work

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