Jump to content

Changing sprite angle from -180 to 180


Raptisha
 Share

Recommended Posts

Hello people!

I ran into when issue when I was developing my new game.

It is a game where arrows show up on the screen and you have to swipe in the direction that the top arrow is pointing to. 

You have to swipe when the arrow is within a certain area on the screen (check the screenshot), represented by a faded arrow in the circle.

That arrow in the circle rotates to the direction that the closes moving arrow is pointing to. I use tween for the rotation animation.

Here is the problem. When the arrow in the circle is pointed to the left (angle = -180) and the incoming arrow point down (angle = 90),

the arrow in the circle is animated clockwise, meaning it goes through top, right and then finally down, not straight down as I want. 

I have set up an if statement to switch arrow's in the circle angle to 180, but it does not work. Changing it to 179 works as expected.

Why can't I change it to 180 in the first place?

Снимок экрана 2017-02-17 в 10.25.50.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...