Search Unity

Resolved No function dropdown in AnimationEvent.

Discussion in 'Animation' started by yardiRT, Mar 23, 2022.

  1. yardiRT

    yardiRT

    Joined:
    Mar 14, 2022
    Posts:
    25
    Hey.
    I try to handle some events during animations, but everywhere I look, every tutorial have access to AnimatorEvent Inspector like this:
    Zrzut ekranu 2022-03-23 o 06.07.07.png
    A nice simple field, where you can select a function, I want this!
    But instead of this, I always getting this sick 5 fields view, and don't have any idea how to handle animation event in this case!
    Zrzut ekranu 2022-03-23 o 06.08.47.png
    I tried to create function test() with debug log, but it didn't work anyway. Why I can't get access to this simple window where I can choose an function?
     
  2. SunnyValleyStudio

    SunnyValleyStudio

    Joined:
    Mar 24, 2017
    Posts:
    67
    Hey!

    It probably is a Unity bug (since you have some preview packages it might be them causing some bug that prevents the refreshing of unity editor to show the correct properties in the inspector).

    The best solution to those kinds of issues is to just restart Unity.

    The only way I was able to change the look of the info about the event is by changing the properties from Normal to Debug.
    upload_2022-3-23_8-46-30.png

    You might want to check that setting - you access it by clicking the 3 dots (marked in red on the screenshot).

    Again since it is not the same screen as yours I would assume that you have some package / asset that affects how the properties of the Animation Event are drawn.

    I hope this helps!
     
    koenigkan12 and heartingNinja like this.
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    This means you did not select the GameObject in scene that has both:

    - the animator with the referenced animation
    - the script where the event function is located

    Go select that GameObject, THEN click on the animation event (or create one).

    Now your inspector will let you pick a method, based on all public methods found in the MonoBehaviour(s) on that GameObject.

    The animation window, NO GameObject selected:

    Screen Shot 2022-03-23 at 8.56.50 AM.png Screen Shot 2022-03-23 at 8.56.54 AM.png

    And now with the GameObject (with Animator and target script) selected:

    Screen Shot 2022-03-23 at 8.57.12 AM.png
     
    Last edited: Aug 19, 2023
  4. yardiRT

    yardiRT

    Joined:
    Mar 14, 2022
    Posts:
    25
    Thank you, that's really helpful!
     
    Kurt-Dekker likes this.
  5. The-Jackelope

    The-Jackelope

    Joined:
    Mar 23, 2022
    Posts:
    15
    Kurt, you are the best
     
    Kurt-Dekker likes this.
  6. Foor1o

    Foor1o

    Joined:
    Jan 5, 2017
    Posts:
    5
    Thanks!
     
    Kurt-Dekker likes this.
  7. heartingNinja

    heartingNinja

    Joined:
    Mar 26, 2015
    Posts:
    35
    Thanks, I am using a package com.unity.nuget.newtonsoft-jason for saving that causes a package error. Maybe this is the reason why had to use this working around.
     
  8. rell023

    rell023

    Joined:
    Mar 29, 2023
    Posts:
    20
    I'm confused, selecting a gameobject changes the inspector to the gameobject which obviously you wouldnt have access to the animation event properties. Selecting the gameobject prior to selecting the animation yields the same result. Can you clarify what you mean please?

    ***Figured it out.

    Just to elaborate for anyone else who may be confused, you have to select the object in the scene hierarchy, then select the animation from the dropdown menu underneath the record and preview buttons in the "Animation" window, not from the content drawer.
     
    Last edited: May 10, 2023
    Piko-Island-Studios and bantus like this.
  9. bantus

    bantus

    Joined:
    Aug 16, 2017
    Posts:
    7
    how does this work for the animation Import settings; in the Events, on the timeline, I can add the event and type the Fnction name, the animator, animation and script(funtion) are all on the playerprefab, there is not function selection and when I Play, I consistently get the same error regardless if it just the function name or I add the namespce.parent.function? Any ideas? the error is Animation Event 'foo' on animation 'foo' has no receiver!
     
  10. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,497
    I'm going to move this to the Animation sub-forum where it belongs. Animation is not a 2D feature.

    Thanks.
     
  11. Piko-Island-Studios

    Piko-Island-Studios

    Joined:
    Nov 30, 2013
    Posts:
    12
    Thanks for the tip. I was getting pretty annoyed :p