running two animations from seperate controllers at the same time, using seperate triggers

Hello Unity Community!

I am making a 2D game and currently i’m focused on dialog part. It’s… ‘advanced’ enough to have 2-3 participants, the looks are very similar to any visual novel you see. Avoiding useless details, I’m more interested in triggering seperate animations, that are not looping, from two different animators (from two seperate objects) at the same time. Imagine one object fading out and other fading in, into its place.
code ex.

[SerializeField] Animator animator_playerSad;
[SerializeField] Animator animator_playerAngry;

(...)

animator_playerSad.SetTrigger("PlayerSadFadeIn");
animator_playerAngry.SetTrigger("PlayerAngryFadeOut");

I need it to be pretty flexible, that means I can’t make seperate animation for every possible combination of moods/faces.

When I tried it, the game seems to activate only one of those, is it possible to play animations like this?

Thank you for any help!

[Edit: typos]

Weird, i feel like that should work. if you comment one out and try the other, does it work? Does it work vice versa? Aka, does one only work no matter the circumstances or does it really limit you to one SetTrigger?

Also, make sure you have the spellings exactly as they are in the animator.

1 Like

thank you very much for reply @Cornysam , when you said it’s werid that it doesn’t work I tried to redo it from the beginning, starting with the simplest code possible, and yes, it worked then. That means I put wrong conditions along the way… oh well :sweat_smile:

1 Like