So i’m trying to do some really basic animatior script. I got this simple script but the problem is that the animation of moving forward is starting only after animation idle stops.
My question is how can I stop the animation when a bool is set on true.
Thank you!
if (Input.GetKeyDown("w")){
anim.SetBool("move_forward",true);
anim.SetBool("idle",false);
}
if(Input.GetKeyUp("w")){
anim.SetBool("move_forward",false);
anim.SetBool("idle",true);
}
you’re question is “idle ↔ moving”, and you’ve provided screenshots for “idle → jump” and “moving ↔ jump” …
first thing I noticed, you don’t need the two bools in the transition from idle to jump, you really just need the “jump” bool, the fact you are coming from “idle state” should suffice without specifically checking that bool (i.e. trust your fsm structure rather than using redundant checks).
next thing I notice is that in the “jump ↔ moving” transitions the blend starts after a period of time, if you have done the same thing in the “idle ↔ moving” transition and you want it to immediately change to the new animation that blend (the diagonal bit) should start at time 00:00, i.e. immediately as the bool is set.