Flip Sprite Based on Mouse Position

0 favourites
  • 3 posts
From the Asset Store
Goodbye to sprite fonts, when you have something new on the anvil for your upcoming Games !
  • I'm very new to Construct, and this is my first post. I have researched this question a lot, and I'm 100% stuck. I want my sprite to flip, right to left and left to right, so that the front of the sprite is always facing the mouse...just left and right, not up and down. I found this expression (If Mouse.X < Player.x Then Mirror), which I understand in code, but I cannot figure out how to input this into Construct 3. I have tried a system event, a mouse event, and an event on the sprite, but cannot make it work. I did successfully set the angle of the sprite to the mouse position, but the sprite rotates instead of flipping. Thanks for any help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm very new to Construct, and this is my first post. I have researched this question a lot, and I'm 100% stuck. I want my sprite to flip, right to left and left to right, so that the front of the sprite is always facing the mouse...just left and right, not up and down. I found this expression (If Mouse.X < Player.x Then Mirror), which I understand in code, but I cannot figure out how to input this into Construct 3. I have tried a system event, a mouse event, and an event on the sprite, but cannot make it work. I did successfully set the angle of the sprite to the mouse position, but the sprite rotates instead of flipping. Thanks for any help.

    hi, first of all you have to add the Mouse plugin in the project otherwise "Mouse" options don's shown..

    then make a new condition from your Player options look at "CompareX" and then on the field "0" type "Mouse.X" then enter

    in action add whatever you want, mirror ecc

  • Your English is fine for me. Your answer was perfect. All I needed was the 'compare X' event. Thanks so much!

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