Forum

> > Off Topic > Gradual Rotation (0-360) or (-180 to 180)
Forums overviewOff Topic overviewLog in to reply

English Gradual Rotation (0-360) or (-180 to 180)

2 replies
To the start Previous 1 Next To the start

old Gradual Rotation (0-360) or (-180 to 180)

Apache uwu
User Off Offline

Quote
I want to gradually rotate an image from one angle to another.

(No I do not want to use tween_rotate--reason why I put this in Off-Topic)

Suppose the image started at 35º, I want it to gradually turn right until it reaches 45º.

This code works.

1
2
3
4
5
function forever()
	if myrot<destrot then
		myrot=myrot+1
	end
end

However if there is an image that started at 35 and I want it to turn left until it reaches -20º how would I do that?

Using

1
2
3
4
5
6
7
function forever()
	if myrot<destrot then
		myrot=myrot+1
	elseif myrot>destrot then
		myrot=myrot -1
	end
end

Does not work
To the start Previous 1 Next To the start
Log in to replyOff Topic overviewForums overview