Search Unity

Remove receiver requirement from animation events

Discussion in 'Animation' started by Steviebops, May 26, 2021.

  1. Steviebops

    Steviebops

    Joined:
    Apr 9, 2013
    Posts:
    132
    I know its usually the opposite way around, but I don't care about the "animation has no receiver" error. :)

    I have several characters that use the same idle animation, but only some of them need the animation event, "hide weapon", that I have attached to it.

    Is it possible to use the DontRequireReceiver from the SendMessage options enumerator in the editor?

    The only other way I can think of is to create an Event Manager and add flags so the character prefabs themselves ignore the animation events.

    That seems a bit more cumbersome.
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    animator.fireEvents = false; should do it if you don't want any events on those characters at all.

    Otherwise just make a script with methods to receive all events and do nothing with them.
     
    Steviebops likes this.