How detect the side of sprite? [Resolved]

Hey guys, i have a problem! My_boss is on the stage, and he goes to my_Player with:

Move My_boss to my_Player with a force of 30 pixels.

All right! he is moving (i would like if the force is only for a X). But i have one animation for left and for right. How he know where the my_player is on? If my_player is on left of my_boss; Change the animation for 2; if my_player is on right of my_boss he change the animation for 1.

Sorry for my bad English.

Check the X position with the appropiate condition, if my_boss is at left the condition:

The X position of my_boss is < my_player.X()

will be true, of course “my_boss.X() > my_player.X()” will be true if my_boss is at right :slight_smile:

Note it may not work if you put the Origin points very far of the default position at 0;0. You could check any point in both sprites with the condition “Compare two expressions”, in case you have to move the Origin :wink:

Great man! very thanks! :smiley: :smiley: :smiley: