- Home /
Rotation of GameObject using iTween
Hi, I am successfully able to rotate a GameObject when the user swipes the screen left or right using:
_itemPOC.Rotate (new Vector3 (0, -touch.deltaPosition.x, 0) * _speed, Space.Self);
However, to make the animation better I want to have an easout affect, so after looking around on the internet I quickly found iTween. I updated my code to this:
iTween.RotateBy(theItemPOC, iTween.Hash("y", -touch.deltaPosition.x, "easeType", "easeOutCirc", "speed", _speed));
But now the animation only begins when the user has finished the swipe action. How can I achieve the affect of rotating a GameObject while the user is swiping left or right with iTween?
Any suggestions are really appreciated!
Answer by dorpeleg · Jul 22, 2013 at 07:51 AM
All the iTween function are not meant to respond to var changes (except those who have "Update" at the end).
You might want to use iTween.RotateUpdate.
The problem is, RotateUpdate doesn't have easing.
So I'm not sure you can do what you want with iTween.
Thanks for the suggestion. I will check the RotateUpdate option. Is there any other way that you know of that I can add an ease out effect to my original code?
There are other "tween" plugins made for unity, google it.
I'm not sure if any of the others are capable of easing in update, but maybe.
If not, the only way left, is to write your own easing script that will work on update.
Your answer
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Rotation via iTween.LookTo not working (or using it wrong) 1 Answer
iTween Edit Rotation Visually 0 Answers
Rotation 90.0001 and 1.001719 bugs! 1 Answer
Distribute terrain in zones 3 Answers