- Home /
How to detach in the middle of an iTween path
I was trying to see how to get a gameObject to stop in the middle of animating on an iTween path. For example, I have a spaceship that flies along the path, but if it gets hit by a bullet, it should immediately go from flying along the path to moving to the bottom of the screen. Otherwise, continue along the path to completion, which sends it to the top of the screen. Any ideas on how I could accomplish this? Thanks.
Answer by LemonPepper · Dec 13, 2012 at 09:46 PM
Sorry. Never mind. I figured it out. Just used another iTween.MoveTo() function. Duh. If anyone is interested, to get iTween to work using Update(), use a timer that counts 0 to 3 after a trigger or event. Example:
void Update(){
if(timer<3){
timer+=1;
}
If(timer==1){
ItweenFunction();
}
}
ItweenFunction(){
iTween.MoveTo(gameObject, blah, blah, blah);
}
Would this work so the player could move to a 2nd spline if they wanted to? If so any idea how I would achieve this? I just got iTween and I'm having a hard time trying to follow it's set functions.
Your answer
Follow this Question
Related Questions
An odd iTween+RageSpline animation issue with trigger/collider! 1 Answer
Run an iTween path backwards? 1 Answer
Dynamic animation method ✾ 1 Answer
Oh yea! Animation addition 0 Answers