//CREATE EVENT
rspeed = 5; //the speed of rotation, how fast it rotates
Point_dir = 0; //the variable that will store what direction to rotate to
Is_Rotating = 0; //is it rotating, used in the STEP event to rotate the object
//LEFT PRESSED EVENT
Point_dir = image_angle + 90; //the angle to rotate to, add 90 degrees to current angle
Is_Rotating = 1; //set to true
//STEP EVENT
if (Is_Rotating == 1) //if its set to rotate the object
{
image_angle += sin(degtorad(Point_dir - image_angle))*rspeed;
}
Can you please further explain how this works please?Code:{ image_angle += sin(degtorad(point_dir - image_angle))*rspeed; }
Its my mistake.Hmm I tried the smooth rotation but it doesnt do anything. Hmmm I dont see any error in the code.
image_angle += sin(degtorad(point_dir - image_angle))*rspeed;
image_angle += sin(degtorad(Point_dir - image_angle))*rspeed;
how would you make it face where the mouse is?Hi and welcome to the GMC!
Put in the mouse left pressed event:
Code:image_angle += 90;
image_angle = point_direction(x,y,mouse_x,mouse_y);