Quantcast
Channel: Programming (In-game)
Viewing all articles
Browse latest Browse all 903

[Solved] Rotate rotor to specified angle

$
0
0
As the title says, I want to rotate a rotor to a specified angle, taking the shortest route. This seems it shouldn't be too difficult, the only problem is due to the fact that 359 is a lot closer to 1 than 358 degrees due to overflow/underflow. However, I can't seem to get my script to work, and it is driving me crazy. Perhaps a new set of eyes might help?

Code:
	 if(angleCurrent < 0)
            {
                angleCurrent += 360;
            }

            if(angleTarget < 0)...
[Solved] Rotate rotor to specified angle

Viewing all articles
Browse latest Browse all 903

Trending Articles