How do I make angle opposite the direction of the touch?

0 favourites
  • 2 posts
From the Asset Store
Rotate & Animation for 16 Direction & Mouse Direction
  • When the sprite is not mirrored the angle of the sprite will follow my touch.x and my touch.y just fine like when i touch up right conner thect sprite will face up right conner

    But when the sprite is mirrored the sprite angle is not exactly the same as when its not mirrored. How do i set the angle still remain the same like when its not mirrored even when it is mirrored? Like when it is mirrored and when i touch on up right conner it will face top left conner?

    This my capx

    Pls help

    dropbox.com/s/p7url8cc69i4dce/reverse%20angle.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you can use set angle instead and use this expression.

    Sprite.Width < 0 ? angle(Sprite.X,Sprite.Y,touch.X,Touch.Y)-180 : angle(Sprite.X,Sprite.Y,Touch.X,Touch.Y)

    That will fix the issue when it's flipped.

    To explain what it does:

    It's a conditional expression that checks the width if it's negative, then sets the angle to -180 if that's true, and sets angle to regular if it's false.

    But the easiest way is to not flip the arrow, unless you really have to.

    Just disable the flip on the arrow and it will work.

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