- Home /
iTween oncomplete not firing?
Hey, so, I'm using iTween, but this one line won't call its oncomplete hashtable parameter. I'm not getting any syntax errors either, and the function is called in other parts of the script with no problems. Any idea why? Here's the call, and the function:
iTween.FadeTo(flameArray[activeFlame].gameObject, {"alpha" : 1, "time" : timeToFadeIn, "oncomplete" : "flameGenerator", "easetype" : "easeInOutQuad"});
function flameGenerator()
{
print("hello?");
var flameGrow = Random.value;
if(flameGrow > .5 || activeFlame == 0)
{
fadeIn();
}
else if(flameGrow <= .5 || activeFlame == flameArray.length)
{
activeFlame--;
fadeOut();
}
}
Answer by Dreamora · Oct 23, 2011 at 12:35 AM
the oncomplete target object is missing. you defined which function to call but not on what object :)
thanks, man! Now I just have to figure out why it won't work in an instantiation...when I instantiate the object this is on, the iTween can't access the object it's supposed to tween.
Your answer
Follow this Question
Related Questions
How to create a bouncing effect 1 Answer
iTween problem - oncompleteparams 2 Answers
iTween.FadeTo - Prevent Going to 100% Alpha? 0 Answers
Event names for itween 0 Answers