How do I make my char mirrored with pathfinding

0 favourites
  • 6 posts
From the Asset Store
Ninja char for your game! Make your own Shinobi game with this art.
  • So, i just added enemy ai with pathfinding, everything good so far, the animation "moving" plays when the enemy is following the path , but the sprite is facing left, when he moves right he looks like he is moonwalking (hahaha) i want to set mirrored the sprite but i cant find a way! can anybody help me? :C

  • so u have the left animation but not the right... try using the sprite.mirror self thing when the direction of movement is toward right... youd have to know the angle is traveling at though if it wold be triggered by keyboard wold be much easier.. but since you have it automatically in an AI system which doesnt depend on ur input.. u need to always check the angle of movement.. one way is to use a custom behavior called speedmonitor which monitors the speed and angle of movement of the object.. and u can use those values in a expression to make the character mirror the animation

  • I fixed it!! i make it work with comapring the x position of the sprite, if the x position is greater than before it measn that the sprite should be mirrored! yei! thanks for the reply! you gave me the idea when you said "u need to always check the angle of movement"

  • Hey I'm having the same problem you had but I can't figure out how to make it compare the sprites X to is previous X position. Can you please show the condition you used (compare X to ?) Thanks

  • Hey I'm having the same problem you had but I can't figure out how to make it compare the sprites X to is previous X position. Can you please show the condition you used (compare X to ?) Thanks

    Hey jskocdopole, here's what you do.

    Create a Decoy follower sprite that follows your main pathfinding sprite wherever it goes maintaining a small relative pixel distance to be used for determining an artificial 'angle of motion.'

    Check out this example.

    https://www.dropbox.com/s/3gelkszlyl6e2 ... .capx?dl=0

    This is one applied to a 'Drag and Drop' sprite but the concept is the same.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the info, I think some of my more advanced students could use this

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