Forum

> > Off Topic > Gradual Rotation (0-360) or (-180 to 180)
ForenübersichtOff Topic-ÜbersichtEinloggen, um zu antworten

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

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

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

Apache uwu
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenOff Topic-ÜbersichtForenübersicht