0 Favourites

How do I make my char mirrored with pathfinding

  • 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

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • 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.

  • 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)
Similar Topics Posts Views Last Post
Unread hot topic
167 14,497
DMT2005's avatar
DMT2005
Unread sticky
1 Favourites
C2 Games made with CocoonIO
136 89,824
minhcuong's avatar
minhcuong
Unread hot topic
99 10,138
karshinkoff's avatar
karshinkoff