Hi, I have a space ship and when it gets hit by an asteroid I want the ship to break apart with an animation. The following is a script I am trying to use. Please help me.
#pragma strict
static var shipBreak : Boolean =false;
Function Start (){
shipBreak = false;
Animation.Stop () ;
Animation.wrapMode = WrapMode.once;
var breaker = animation (“Ship_Destroyed”);
Ship_Destroyed.speed *= breakerSpeed;
}
Function Update (){
If (shipBreak == true) {
Animation.CrossFade (“breaker”) ;
}
}
Also I wrote another script caled animation Instagator and it looks like this…
#pragma strict
Function Start () {
animationPlayer ();
}
Function animationPlayer() {
yield new WaitForSeconds (3);
Ship.running = true;
}