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?

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.

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
                ));

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));