- Home /
Play animation after iTween
Hello,
I need an animation to play when my object is finished using iTween.LookTo. Is there a way to tell if my object has rotated to the lookTo spot?
any ideas would be great.
var armHolder : GameObject;
function Update(){
var hit : RaycastHit; var ray : Ray = camera.ScreenPointToRay (Input.mousePosition);
if(Input.GetButtonDown("Fire1")){ MoveArm(hit.point); } }
function MoveArm(hitSpot : Vector3){ iTween.LookTo (armHolder,hitSpot,.5); //When the Tween is finished I'd like the animation to play// }
Answer by Joshua · May 16, 2011 at 11:29 PM
I have little experience with iTween, but isn't the third parameter of the function you use the time in which is should be executed?
iTween.LookTo (armHolder,hitSpot,.5);
if so, simply use
yield WaitForSeconds(0.5);
Your answer
Follow this Question
Related Questions
Custom Easing Types using Curves for Motion? 3 Answers
Octopus movement 0 Answers
iTween and animation at the same time 0 Answers
Is it possible to generate a Path from iTween? 2 Answers
Character Controller surpassing Collider with iTween 0 Answers