- Home /
iTween Constant Rotation
Hey guys,
I'm trying to figure out a method where the object can rotate around the X-axis in a fixed position using iTween. I've played around with it a lot and still can't figure it out. I have tried multiple methods on the documentation page, such as: RotateTo, RotateBy and ShakeRotation.
Does anyone know how to figure this out?
Answer by hdgam3r · Oct 28, 2013 at 12:46 AM
Have you tried with rotate by?
iTween.RotateBy(gameObject, iTween.Hash("x", 20.0f, "looptype", iTween.LoopType.Loop));
What this does is rotate around the x axis at an ammount of 20.0f units, while looping forever.
Please double check the code since I haven't tested it.
Hope it helps.
That worked perfectly, I'll play around with it and customize it a little more now, thanks!
Answer by Bryan-Legend · Jan 29, 2016 at 05:27 PM
Here's some code that I use to spin on the Y axis once every 3 seconds.
iTween.RotateBy(item, iTween.Hash(
"y", 1.0f,
"time", 3f,
"easetype", "linear",
"looptype", iTween.LoopType.loop
));
Answer by ShanMirza28 · Nov 14, 2018 at 06:25 AM
For constant rotation on y axis. just add easeType and set it to linear.
here is the code. iTween.RotateBy(gameObject,iTween.Hash("y",1,"time",5,"looptype",iTween.LoopType.loop,"easetype",iTween.EaseType.linear));
Your answer
Follow this Question
Related Questions
Problem when i rotate a 2d object aroun Z-axis 1 Answer
Rotate object in the direction where it is going 1 Answer
How to rotate an object with animation? 0 Answers
Why the player is not rotating and moving at the same time ? 0 Answers
How do I combine Orbiting with mouse drag and with a button click? 0 Answers