animator layer swap
Is there a way to swap animator layers as in.
My character has different play styles. Each style has their own set of animations. I want to press a button that changes to that style until the button is pressed again then it goes back (or cycles through several but I can figure that part out). The controls are the same but completely different animations. I think this can be done with layers? Where one can become the set of animations used then I can swap the layer being used until I switch layers again, back and forth at runtime? I'm likely overlooking something simple. Or maybe I'm not even on the right path about how to do this.
So far what I've tried is listed below
I tried switching animator controllers during runtime but that caused issues. Right now I'm slowly going through each individual animation state on the base layer using basic Boolean to use the other animation like bad quick example.
void Transfrom(){
if(Input.GetButtonDown("Transform"){
if (playerTransformed = true) {
animator.Play ("Transform1");
playerTransformed = false;
} else {
animator.Play ("Transform2");
playerTransformed = true;
}
Your answer
Follow this Question
Related Questions
How do I puse an animation? 1 Answer
How to set the blend tree threshold value during run time? 0 Answers
Continuous keydown in Animator 0 Answers
Why default animation state rewrites scale of an object? 0 Answers
Animation Running Game 0 Answers