- Home /
How to do seveal actions like scale on an object one after another?
Hi,
I need to scale an object in x axis for like 2 seconds, then scale it back, then scale it in Y axis for 2 seconds and scale it back.
Question is, how to do these consecutively.
Thanks.
Answer by Subhajit-Nath · Jan 04, 2014 at 05:02 PM
You have many options for doing this.
Use Vecor3.Lerp or you can use tween animation extensions like iTween.
http://docs.unity3d.com/Documentation/ScriptReference/Vector3.Lerp.html
I need to do four actions one after another, I think tweening and lerping helps me do one of them.
Please correct me if I'm wrong.
That's where loops come in. Use loops for that in conjunction with Lerp or tween.
Answer by HappyMoo · Jan 05, 2014 at 01:24 PM
start a Coroutine that keeps animating and yielding null till 2 secs are over, then call the next Coroutine and end itself
http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.StartCoroutine.html