- Home /
Mechanim Trigger Issue
Currently we are having an issue where a trigger is being ignored on our lower body layer, but not on our upperbody layer. When the player chooses to aim on stairs and then perform a dodge roll via a trigger, the trigger does fire, but the lower body transition is ignored. We are in two different mechanim states at the time of the aim on the stairs, the normal "Movement Tree" on the upper body & "Stair Tree" on the lower body. After a dodge roll is initiated the trigger is now active "supposedly" for both layers regardless of what state each layer is in. The upperbody produces the correct results and exits via transition to the dodgeroll. The lowerbody however ignores the trigger completely causing an issue with the animation because the lowerbody is needed to perform a proper dodgeroll.
Thoughts on what may be my problem here. Clearly, or at least its assumed, when on any state on any number of layers transitions should respond to triggers.
Answer by sh_code · Jan 14, 2019 at 03:23 AM
not enough information to properly answer you. also, I recommend leaving the assumption that it's a bug in the engine, as the LAST resort. because 99.9% of the time, that assumption is wrong.
My psychic debugging powers are telling me that the layer which "ignores the trigger" does so because on that layer, you're not in a state which has a transition with the trigger, but in some other state, not connected to where you want to get.
@sh_code I'll investigate that, but afaik even if for any reason i am exiting the "Stair Tree" blend tree it can only go to 3 different states which are "$$anonymous$$ovement Tree", "Boy_Attack01", and "Boy_dodgeroll". The most likely of the three for the lower body is "$$anonymous$$ovement Tree" and even if it was there is still a transition via dodge trigger from that state as well. It is possible though that right after the dodge is initiated it could very well be transitioning to the "$$anonymous$$ovement Tree" state during the time period that the trigger is set causing the trigger to fail due to the fact that the transition process itself takes time. When analyzing the lowerbody layer there was no clear indication to me that it was even exiting the "Stair Tree" until the player is actual off of the stairs. I mainly blame unity devs out of frustration :D
not sure I understand fully (yes, this is a bit complicated for text description), but if the problem is that your state doesn't even get out of the stair tree, maybe try to play around with the "interruption source" settings, so that even a state two states away from where you're now can force to jump out of it.
sorry I can't suggest anything more specific.
I also would have been able to illustrate my issue a little better if we were provided more than the limit of 2 attachments. ;)
Your answer
Follow this Question
Related Questions
Nicer Mecanim transitions? 1 Answer
How to fluently transition into an animation state? 0 Answers
mecanim trasitions auto reset 0 Answers
Make mecanim transition after a delay in Unity3D 0 Answers
Interrupting animations 1 Answer