- Home /
Mecanim, using an empty state
Hi everyone! I'm currently working on an animator state machine and a controller script. I have a set of different idles, which I have to organize properly. So I've decided to create a sub-state machine, place an empty dispatcher state there and use it to control idles. The idea is simple: when we are in the empty state, a random float is calculated. According to this float we set an integer parameter to the appropriate value. This should initiate one of the transitions from the empty state to an idle. As soon as the idle finishes playing, another transition returns us back to the empty state... and so on...
In fact this structure works similar to what is expected, but my character suddenly falls through the ground and then restores his actual position - this happens very often. I suppose, this is because unity tries to play the null animation in the empty state.
1) Is it possible to make this structure work correctly?
2) How can I use empty states in mecanim without getting bugs?
Just wondering if you found a solution to your problem. I am suffering from the same "bug". $$anonymous$$y character falls through the ground during a transition into an empty state.
Well, in fact, it is helpful to read about $$anonymous$$ecanim layers. At first, I didn't get this point. But when I realised, that $$anonymous$$ecanim layers are similar to Photoshop ones, things became much clearer.
Returning back to the subject - layer, that plays an empty state is like a fully transparent layer in Photoshop. And here's the idea: if you add (in PS) any other non transparent layer X, you will see exactly this layer X. The same with $$anonymous$$ecanim: if you have a layer, that is playing an empty state, add another layer with some valid state playing. You can't play an empty state itself, but you can mix it with a valid state and play them together.
I have a animation playing one layer below the empty state and it still has the issue. This is a recent problem since upgrading to 4.3 so something might have changed with their blending layers during transitions.
Hello, I think I have the same problem in Unity 4.3 too...
I have created a layer to animate the character turns on the upper body with override blending. The turns to the right and left start correctly from an empty state, but during the transition back to this empty state seems that the character tries to return to the T-pose, ins$$anonymous$$d of blending with the lower layers properly.
I'm with you, I think this is a Unity 4.3 bug.
i have the same problem, animations are ugly when transitioning back to empty (on an overriding layer). Since 4.3. Any way to make the devs notice this? Or a workaround?
Answer by T.Tondee · Feb 10, 2014 at 07:31 PM
This was a bug with Unity and has been fixed with 4.3.3 as far as I can tell, hope this helps with everyone else's problem because it fixed mine.