- Home /
ÇHow can I activate and deactivate an iTween animation over an object?
Hi mates!.
My question is : how can I activate and deactivate an animation made with iTween?.
I've got my iTween animation applied over an object with their child objects inside and I want that this object appears, execute its animation and disappears when the animation is completed.
I want to control the appearing and playing its animation when a counter reaches some value from another script.
iTweenEvent.GetEvent(WOW, escalado).Play();
Inside an if with the counter reaching the trigger value I tried to activate the animation...But the animation didn't start.
Other option could be activate and deactivate the object with the option "play automatically" activated...But I think it's not very elegant.
I'd like any way to handle these events in javascript for iTween inside Unity3D.
Thank you very much in advance.
Answer by timsk · Sep 30, 2011 at 12:46 PM
Just put the iTween code in a function, then call that function when you need it.
Pseudo-code:
function AnimateCube()
{
iTween.animationcode
}
function Update()
{
if(animate = true)
{
AnimateCube()
}
Your answer
Follow this Question
Related Questions
An odd iTween+RageSpline animation issue with trigger/collider! 1 Answer
Can I make animations snap to a frame? 1 Answer
iTween Char Animation 1 Answer
Using iTween for custom variables 3 Answers
Update iTween Path at Runtime 1 Answer