Hi, i have imported a model of a flying ship with 2 (actually 3) animations, one to move the propellers and the other two to turn right or left the alerons, the animations are like this on the imported model:
Running propellers = frame 0 to frame 10
Turn left the alerons = frame 10 to frame 20 (turn and back to initial position)
Turn right the alerons = frame 20 to frame 30 (turn and back to initial position)
So, the model its imported OK into Unity with the 3 animations set, but i dont know how to play the running propellers animation and AT the same time play one of the other 2 animations for turning right or left while the propellers are still runnig.
The problem is that when the turn animation occurs, the propellers are still (between the frames 10 to 30 of the FBX model), i know there is a way to mask a specific part of a single model, but im not sure how to do it, anybody have a clue?, Thank You!
I really think you should create individuals animations for what you are trying to do here. When this will be done, set your Running propellers animation to Clampforever mode (wrapMode). So when it will be played, it will loop the last frame “forever” until you say anything else.
Then, with 2 individuals animations for each alerons (going right and going left) I really think you do more specifics things!
If your models have legasy animation and some bones, you can use layers and mixing animation. Example see below (write on CSharp):
//For example, your model have tree bones by names MainBone->CenterBone->Propeller
//Animation propellers only for bone "Propeller", animation is Loop
//Animation turns for bone "MainBone", animation is Once
void Start() {
//Find animation propellers and set layers more than other animation. Default is 0
this.animation["myAnimProp"].layer = 2
//Find bone for propeller and add mix. That play animation for propeller is only bone "Propeller"
this.animation["myAnimProp"].AddMixingTransform(this.transform.Find("MainBone/CenterBone/Propeller"));
}
void Update() {
//Play animation propellets
this.animation.CrossFade("MyAnimProp");
//Play animation turn of key down
if (Input.GetKeyDown(KeyCode.L)) {
this.animation.Play("MyAnimTurnLeft");
}
}
Attach this script at your model on Scene. I hope that it will help you.
Sounds like an animation layer issue. There should be a video about mechanim on learn section or unite where they show a character wave his hand while running at the same time. You should check that out.