• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML How to make objects rotate

M

michelle6639

Guest
Is there any way on GMS2 to make a wand or such rotate? One side stay in one place and the other side changing position to follow the mouse? If i;m not making any sense, it is like the hands of a clock.

So far i have used the code
image_angle = point_direction(x, y, mouse_x, mouse_y);
but the top end is pointing a little off from where the courser is (about 115-140 degrees, just guessing).
 

obscene

Member
Your original sprite needs to be pointing to the right (0 degrees) in order to line up correctly with point_direction. You also want to set the origin to the point in the sprite that shouldn't move, ie, the leftmost point of the sprite.
 
Top