- Home /
Question by
Henning_Justare · Mar 12, 2015 at 01:10 PM ·
triggermecanim
Play sub-states based on triggers. (mecanim)
Hi all,
I need some help with mecanim, I want to play different sub-states machines based on triggers.
The code is very basic:
int index = Random.Range(0, 3);
switch (index)
{
case 0:
physicalAnimator.SetTrigger("JumpingJacks");
break;
case 1:
physicalAnimator.SetTrigger("PowerJumps");
break;
case 2:
physicalAnimator.SetTrigger("HeighKnees");
break;
default:
break;
}
It's the The Base layer and sub layers looks like this:
The problem is that I can see the triggers being set as they should, but the transitions from "Any State" isn't being triggered?
The transitions are setup like this:
I haven't worked with Sub-States before, so I don't know if I'm doing anything wrong.
Hope someone out there knows what I'm doing wrong.
Henning
transitionsetting.png
(17.8 kB)
baseandsub.png
(34.8 kB)
Comment