Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: derkoi on June 08, 2014, 01:35:38 PM
-
Hi,
I'm trying to animate a game object from one position to another position in script. I did use TweenPosition.Begin which was fine but I need a smoother animation curve.
I added a tweenPosition component to the game object, adjusted the animation curve to my liking and enabled it via the script. It worked fine once, but when i try to reset the to & from values and re-enable the script it won't allow me to. I can't even enable the script via the check box in the inspector once it's ran once.
I also tried ResetToBeginning() but that didn't make a difference.
Is there something I'm missing please?
Thanks
-
I had exactly the same problem, so I decided to use iTween instead and then everything is working fine.
The only caveat is that you might need to disable anchors or set them to update on enable only
-
ResetToBeginning() will reset the tween to the starting position, which may or may not be what you want. In your case, simply set to 'from' and 'to' values and call the tweener's PlayForward() or PlayReverse() function.