Hey everyone,
I have researched a lot, and it looks like Unity is forcing me to use this state machine GUI that is part of the animation controller. I would really like to be able to do this programatically myself instead. I would really like to manually control exactly what animations are in effect, and what position in their playback they are at, how much weight they have in the mix of currently active animations etc.
Is this possible?
I’m pretty sure you can still run it in Legacy mode and control everything directly through your script files. This is how it was in the older version of Unity(hence the name, Legacy).
Hope that helps!
Thanks for the reply Roumenov, but it looks like that stuff is deprecated and likely to be removed sooner or later, so I’d rather avoid it.
Surely most people using unity would appreciate the option to directly control this kind of stuff. It’s like the unity creators have decided that everything anyone could possibly want to animate can be easily mapped into simple states and transitions based on 4 different types of conditions…
I am in the same boat korbbit.
Mechanim adds a lot of awesome features for things like configuration of blend trees but makes driving anything yourself out of the question.
The playables API looks to have the intention of giving a bit more power to the programmer, but currently only adds the ability to blend between 2 different animation controllers or a plain animation.
What I use a fair bit, is calling Animator.Play() for specific layers each frame which will force the position of the normalizedTime on a specific state. The roadblock I am up against now is I am unable to manually control transitions on a frame by frame basis.
If anyone from Unity is listening, most of this could be solved by simply exposing a new method along the lines of:
Animator.CrossFadeExplicit(int layer, int nameHashA, int nameHashB, float normalizedTimeA, float normalizedTimeB, float transitionProgress)
The key point here is giving us the ability to call CrossFade each frame with an explicit transition position. As some layers rely on calling Animator.Play each frame, any call to CrossFade is stomped by the following frame without this function.
I just submitted a suggestion, show some vote love here: