- Home /
Animator Override Controller Layer Issue
Hello
I have multiple "characters" in my game and I'm using an Animator Controller that is setup with the state machine that I need. To animate the "characters" I'm using Animator Override Controllers with the correct animations for each different "character".
The state machine has a base layer and a override layer. I've doubled checked and the settings for both layers are identical, the only difference is the layers reference different animations for the same "character".
I have a trigger that is controlled via code to alter the state machine, the trigger works as intended when the weight for override layer is set to 0, but when I set the override layer weight to 1, I get the correct animations, but the state machine seems to randomly ignore the trigger i.e. sometimes it changes state, sometimes it doesn't.
Does anyone know why it does this?
Thanks.
Still need help on this, everything seems to work correctly except the trigger doesn't respond correctly when the weight is set to 1 on the override layer.
So I recreated a test project to see if anyone can figure out the issue, if not I'll have to try a different way of doing things.
https://www.t27m.co.uk/public-files/index.php?file=AnimHelp.rar&unity=true
Answer by Ben-Stoneman · Jan 06, 2015 at 06:06 PM
Hi T27M,
I'm guessing you want the boss to use his special animations when the "pin" hits him? Why not simply change the weight from 0 to 1
In regards to setting the trigger, the example never sets the trigger on the pin.
I know this is a late answer, however, I think the way you were trying to create this mechanic needs some rethinking.
Hey, thanks for you answer. The trigger does actually work, but you have to manually move the Pin gameobject in the scene view to make it collide with the boss gameobject.
As for your suggestion to set the weigt from 1 to 0, that is exactly what I was doing. $$anonymous$$y problem was that when the weight was 1, the trigger was ignored completely, but it worked when the weight was 0.
When I uploaded the example it didn't work, but I have just reimported that project into 4.6 and it actually works as I was intending it to in the first place. I did forward this question on to the support $$anonymous$$m and although I didn't get a response here, it seems to have been fixed.
Using this method, in our game, I was able to use one base animation controller with multiple animation override controllers that changed the sprite, but not the behaviour of the character. I also didn't need to modify any code for each new character.
I see, I guess we can say this is resolved?
I replied to this because we made record of your question, however we have been unable reply swiftly to questions sent into support that the community has not answered. I will ensure I do all I can to improve this.
Yes, everything is now working as intended. Thanks for the response! Better late than never ;)
Your answer
Follow this Question
Related Questions
Sprite Animation Controller Layer on top of each other? 0 Answers
Display additional animation on top of other animations 0 Answers
Dynamically add / remove layers from animation controller through script 0 Answers
What is the proper way to wait for an Animator Controller to update? 1 Answer
Unity 2d Animation from spritesheet: How can I move the character according to the animation? 0 Answers