Search Unity

'Player' AnimationEvent 'NewEvent' has no receiver! Are you missing a component?

Discussion in 'Animation' started by Marsa-Palas, Mar 5, 2015.

  1. Marsa-Palas

    Marsa-Palas

    Joined:
    Mar 4, 2015
    Posts:
    8
    I have a gameobject named "Player". I made new AnimatorController, added 2 Animations and put it to Animator component of my Player gameobject.

    I keep getting error
    'Player' AnimationEvent 'NewEvent' has no receiver! Are you missing a component?

    I've looked some earlier threads, and that didn't solve the problem.

    Unity version I'm using is the newest one, Unity 5.0 stable version.
     
    nadcdc4, freezman13 and Daavlot like this.
  2. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    You probably did add a Animation event named 'NewEvent' on one of your clip. But you didn't add the MonoBehaviour on your game object with a function to answer this event.

    Select your animation clip asset file and remove any event that shouldn't be there.
     
  3. Marsa-Palas

    Marsa-Palas

    Joined:
    Mar 4, 2015
    Posts:
    8
    Please bear with me, I'm trying to see events in my animations, but when I click/double click on animation, it doesn't show animation window. I try to open Animation window from Window -> animation, but it only shows up window with no events.

    Just to mention that I'm using Animation clips from Survival shooter (Idle and Move)
     
    Sushi8819 and Daavlot like this.
  4. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Once you animation window is open, select you game object with the Animator component.
    Browse all the clip from you controller and look if one of them does have some animation event that are not setup correctly, simply remove them.
    animationevents.png
     
  5. Marsa-Palas

    Marsa-Palas

    Joined:
    Mar 4, 2015
    Posts:
    8
    Thank you for you answers!

    I tried to do what you showed, but I didn't get the list of events as you. There is some warning message in animation window. Screen Shot 2015-03-06 at 8.13.46 PM (2).png
    I found events like this Screen Shot 2015-03-06 at 8.14.20 PM (2).png
     
  6. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Exactly, this was the next thing to try. If the clip is read-only then you need to look at the model importer and see if some animation event were added.

    The reason why you get this warning in the animation window is because you did check the Optimize Game object hierarchy for this asset in the model importer under Tab Rig.
     
  7. Marsa-Palas

    Marsa-Palas

    Joined:
    Mar 4, 2015
    Posts:
    8
    Yes, that's exactly the reason why it didn't show anything in Animation window, but I wasn't able to find Optimize Game Object option. Thank you again!
     
  8. Strasak

    Strasak

    Joined:
    Oct 18, 2015
    Posts:
    1
    I had same problem... :D
    Thank you!
     
  9. Daavlot

    Daavlot

    Joined:
    Sep 7, 2016
    Posts:
    1
    Same problem with Survival Shooter (+1)

    But in the end, how should I remove this error? How can I uncheck Optimize Game Object? I don't really want to reimport, as that would override my whole work, wouldn't?

    Update: Actually, the game works perfectly despite the error message. Maybe I shouldn't bother, but the error message is just annoying me. Should I just leave it as it be?
     
    Last edited: Sep 7, 2016
  10. johnCordeiro

    johnCordeiro

    Joined:
    Mar 15, 2016
    Posts:
    6
    The problem comes from a new event on the Zombunny's Idle clip. simply go to the Models / Characters folder and select Zombunny. in the inspector under animation tab / clips select the idle clip and expand events. Select the event on the time line and right lick and choose delete event.
     
    Virtesia, olonge, NarutoU21 and 6 others like this.
  11. Jamy4000

    Jamy4000

    Joined:
    Apr 12, 2017
    Posts:
    5
    Thanks guys, I was having the same issue, you're awesome !
     
  12. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Hey thanks!
     
  13. OG_Jacob

    OG_Jacob

    Joined:
    May 17, 2015
    Posts:
    10
    Thank you.
     
  14. kishore_1234

    kishore_1234

    Joined:
    Aug 14, 2017
    Posts:
    8
    thank you so much
     
  15. pixels90211

    pixels90211

    Joined:
    Aug 25, 2017
    Posts:
    1
    Awesome,.. same problem here... only difference was that the event was in the Player Death event animation
     
    imcheney likes this.
  16. unity_DWqPTElXD3Yx_w

    unity_DWqPTElXD3Yx_w

    Joined:
    Dec 6, 2018
    Posts:
    1
    thanks!
     
  17. nvoid078

    nvoid078

    Joined:
    Aug 3, 2019
    Posts:
    1
    Very helpful thanks for this forum helped solve my issues
     
  18. workaholicdemel

    workaholicdemel

    Joined:
    Dec 18, 2019
    Posts:
    1
    Just Check To See If The Name You Have For The Event Is The Same As Whats In Your Script. I just had this problem then i realized that my event was named similar but not the same as my script. JUST CHECK YOUR NAMING AND EVERYTHING SHOULD BE FINE
     
  19. CodingIdaho

    CodingIdaho

    Joined:
    May 16, 2020
    Posts:
    1
    How exactly do you right lick? Also, where is the models/characters folder?
     
  20. walll-aguiar

    walll-aguiar

    Joined:
    Apr 24, 2020
    Posts:
    3
    I solved it that way, right click restart level,delet animation event. Player animation eventrestartLevelhasnoreciverr.JPG
     
    Last edited: Aug 11, 2020
  21. tangyinglin0228

    tangyinglin0228

    Joined:
    Apr 23, 2018
    Posts:
    16
    I am having this problem as well in 2019.4.8f . When I play the scene directly, everything works well but when I load the scene from another scene(selecting stage). I get this error message half of the time. Will update it when I fix this.
     
  22. Recluse

    Recluse

    Joined:
    May 16, 2010
    Posts:
    485
    I'm trying to sync a particle effect with an animation in Unity 2019.4.11f.

    I added an event to an imported animation, with the function name 'OnExhale'.
    I then added a script (to the same Game Object containing the animator component, not a child of), with a public function OnExhale().

    This function isn't found and I get the 'no receiver, are you missing a component?' error.
     
  23. Recluse

    Recluse

    Joined:
    May 16, 2010
    Posts:
    485
    EDIT: Duh! It does work - the error was coming up on a completely different game object which wasn't supposed to use that animation.
     
  24. CrossAngeluS

    CrossAngeluS

    Joined:
    Aug 2, 2018
    Posts:
    2
    I'm using the Events from Animation Editor to call a "Destroy" and "Active" simple actions like that:

    public void selfDesctruct()
    {
    Destroy(gameObject);
    or
    gameObject.SetActive(false);
    }


    but I got the same error:

    >>>>> AnimationEvent 'NewEvent' has no receiver! Are you missing a component?

    I was told that I can't use them on Animation Editor events, is that right?
     
  25. Recluse

    Recluse

    Joined:
    May 16, 2010
    Posts:
    485
    Is 'NewEvent' the correct name for your animation event? Do you have a script containing a method called NewEvent() on the GameObject the animator is a component of? If not, there is nothing to receive the animation event. It looks as if your animation event should be called SelfDestruct. Did you forget to hit 'apply' when you named the animation event?
     
  26. Nolaif

    Nolaif

    Joined:
    Feb 9, 2014
    Posts:
    21
    My case was that I use the same animation for several characters. But it seems that there is a keyboard shortcut to insert events because at the beginning there were no errors. Events were inserted while placing assets on stage. When reading the forum, I discovered that there were 3 events in Animation-Events. So it was a surprise to find 3 events that I never inserted.
     
  27. saadaamir3047

    saadaamir3047

    Joined:
    Sep 12, 2021
    Posts:
    4
    I was just having the same Issue. It was actually due to 2 prefabs trying to use the same animation event, with different scripts & different Functions names.
    When I changed the event in the first one, the 2nd one started causing issue & vice versa.
    The quick solution to this was making using same function names on different scripts for the single animation.
     
  28. gooby429

    gooby429

    Joined:
    Aug 13, 2019
    Posts:
    136
    tbh this seems like a bug at this point because it provides almost no information and ruins the point of override controllers
     
  29. troynall

    troynall

    Joined:
    May 19, 2018
    Posts:
    10
    you will get a simular Error message in "Emerald A.I. 3.0" BUT the error message will include EXACTLY where you added(drag and dropped) an animation. The solution is the clear Animator Controller AND THEN Regenerate Animator Controller. -Just overwrite your Old Animator Controller.
     
  30. Smams68

    Smams68

    Joined:
    May 28, 2023
    Posts:
    15
    I had a similar thing! Just human error that was very hard to diagnose. Thanks for giving me the idea.
    Sometimes copy/pasting is more trouble than it's worth if you are not careful.