Hi there,
I have been using iTween recently and it’s Great! But I am having this one issue that seems to pop up a bit, just wondering if anyone here knows a good workaround…
I’m using itween to punchscale a button when the user presses and releases it. The problem is that if the user releases the button before the “press” punchscale animation finishes, the “release” punchscale animation starts from whatever scale the button is at in that moment, so if generally ends up getting bigger over time.
I tried to put something like this before the iTween script to make it reset the scale of the button but it didn’t really work quite right.
LeftButton.transform.localScale = Vector3(1,1,1);//Reset the scale
iTween.punchScale(LeftButton,{"amount": Vector3(-.3,-.3,-.3), "time":1.6});
Does anyone with some iTween experience know how to get around this issue?
I’m sorry I never got back to your email; life has been busy and I’m really trying to get iTween 2.0 done, take care of my pregnant wife, the insane amount of home improvement projects… ok I’ll stop complaining.
Have you considered using an ‘onStart’ callback that resets the scale when each iTween is run? I think I may have left a bug or two in iTween 1 that causes it to not grab the correct ‘current’ values when an iTween starts and that may be why your reset attempt isn’t working.
Let me know if the callback solution doesn’t help.
Never mind, I always seem to get it working myself after posting it in the forum. the onstart function that calls for resetScale, i had to put the function in the object itself.