- Home /
Is it possible to make empty, passing state in mecanim?
Hi,
As topic says, is it possible to make state in mecanim which will be used as passing state for other states? In my case, I have a few fighting states and regular walking, idle, turn around etc. states. I want to make something like FightTransitionState so that when character gets into fighting it is then decided which fight move (state) will be next. It would be cleaner if I have that kind of state which would be used as "base" state for other fight moves. Now, if I have for example 20 moves and I want to be able to connect them all or some of them, it would make spaghetti in my animator window. Cleaner solution would be to have a base state and a star like graph which will represent fight moves.
I have read few answers and I tried myself something with empty state but usually character falls through or some other bug.
Thanks
Answer by komodor · Dec 03, 2013 at 12:17 PM
yes it is possible, but does not work, because the empty state interrupts blending
for me http://docs.unity3d.com/Documentation/ScriptReference/Animator.CrossFade.html is the most comfy path now
Answer by mujpir · Dec 03, 2013 at 12:21 PM
If i understand you correctly , your problem is connecting every run , idle , walk , ... to every fighting state ??? If so , You should place fighting states in an upper layer ad make a transition from 'any state' to every fighting state . 'any state' means which state our animator is currently on .This way, it wouldn't need to create a transition to fighting states for every animation in base layer . Hope it solve your problem
Answer by baneand · Dec 03, 2013 at 02:43 PM
'Any state' solution is what I am thinking of currently, and it is probably the best solution at the moment. Problem still persists in transitions from fighting animations to idle, run or walk. Or between fighting animations. There will be lot of fighting animations which need to be connected. When I add new animation I would need to connect it to many of the current animations. If I have some central state I would be able to connect only to that state.
there is (and maybe it will be changed in future) problem with any state as the state you just got in is also any state, so you might get problems with animations trying to morph to itself
Your answer
Follow this Question
Related Questions
How to generate Mecanim Sub-state namehash? 6 Answers
Not able to use a Vector as a condition in Mecanim? 2 Answers
How do I make the transition between two states in the "Animator" happen instantly? 3 Answers
How to get fileID information so i can just edit Mecanim Animator through script? 2 Answers
Continuously Play Animation Forwards and Backwards with Mechanim 0 Answers