- Home /
itween on all gameobjects in array: last one doesn't finish tween
hi there!
i have an array of gameobjects and I want to scale them all in a row by itween. so I put up this code
foreach(GameObject icon in allQuestIcons) {
if(icon != null) {
ScaleUpSprite(icon, 1.5f, 1f, .1f*indx);
indx++;
}
}
with
void ScaleUpSprite(GameObject toScaleObject, float amnt, float tme, float dly)
{
Vector3 scaleVector = new Vector3(amnt,amnt,0);
iTween.ScaleFrom(toScaleObject,iTween.Hash("scale",scaleVector, "delay", dly, "time",tme, "oncomplete", "ResetScale"));
}
but the last gameobject in the array never finishes its tween.
can anybody tell me why?
thx!
Answer by pixelplacement · Feb 04, 2011 at 05:04 PM
How far does it get? What's in your ResetScale method?
it works for every object in the array exept for the last one. for me it seems that the last object of the array is scaled up but then not back to the starting value (although i used "scaleFrom"). so i added the reset-function which is just a localScale to 1. this one woks for every object but the last, again.
Your answer

Follow this Question
Related Questions
Create smooth animation in path finding 0 Answers
iTween gradual jump 2D 0 Answers
iTween MoveBy with Transforms 1 Answer
using iTween on multiple objects within a function. 1 Answer
iTween MoveTo shoots off into distance 0 Answers