Search Unity

Prefabs and Animation Events

Discussion in 'Animation' started by Necronomicron, Apr 18, 2019.

  1. Necronomicron

    Necronomicron

    Joined:
    Mar 4, 2015
    Posts:
    108
    Hi!

    I have a button prefab and animation clip. I've added event but I can't see how I can call a function from it. Function list is empty.

    Also is Timeline just a replacement for Animation, Animator or both? If so, should I just redo all my clips and states in it if possible?
     

    Attached Files:

    Last edited: Apr 23, 2019
  2. Necronomicron

    Necronomicron

    Joined:
    Mar 4, 2015
    Posts:
    108
  3. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Does the object with the Animator attached have any components attached with public functions that the event could call? I've only ever used the old interface where you have to type in the function name, but I would assume it's just looking on the object for any valid methods.

    Timeline is not a replacement for anything. I haven't used it either, but as I understand it it's mostly geared towards making cutscenes and stuff where you need to manage multiple animating objects at once. I don't think it would be very useful for general gameplay animations.
     
    Necronomicron likes this.
  4. Necronomicron

    Necronomicron

    Joined:
    Mar 4, 2015
    Posts:
    108
    I tried to add public methods and it doesn't see them anyway.
     
  5. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Maybe have a look at the documentation to see if there's an updated explanation for how to use Animation Events with that new dropdown menu. Or find a recent tutorial.
     
  6. Necronomicron

    Necronomicron

    Joined:
    Mar 4, 2015
    Posts:
    108
    I tried before creating this thread, all I found was obsolete or off-topic. If I select just clip file, I see that name/value nonsense instead of dropdown menu.
     
  7. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Then just use that. I expect the dropdown menu is just a dumbed down front end for the same data structure it has always used. Needing to manually type the name isn't great, but it gets the job done.