Mechanim and sub state machines

Hi, I have a really complex Animator with 250 different animations so because of that I have to use sub state machines since all those animations at the same state looks confusing.

My problem is I cant get the current state of the animation.
I tried
static int j3 = (“Base.j3m”)
and it didnt work than I tried
static int j3 = Animator.StringToHash(“Base.Jumps.Forward.j3m”);

and it also did not work. I guess there is different method to call the adress of states under different sub state machines, I wonder if any one can help me with it.

Thanks in advance

Hi,

a.) StringToHash requires the name of the state - it looks like you’re trying to supply the filename of the file containing the animation.
b.) You refer to a state in the base layer as “Base Layer.state”, not “Base.state”

So, assuming your state is called “Jumps Forward” and it’s in the base layer, you can get the hashid using:

Animator.StringToHash("Base Layer.Jumps Forward");