Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Help Wanted How do animation events find their functions on a gameobject?

Discussion in 'Animation' started by lejean, Jan 30, 2021.

  1. lejean

    lejean

    Joined:
    Jul 4, 2013
    Posts:
    362
    If I just assign a string function to the animation like in the picture does this do some kind of "Iterate over all the components" untill it finds a function with that name?

    How performant is this when you have alot of components?
    If a result is found is this then cached or does it do a lookup every time the animation plays?

    animation event.png
     
  2. lejean

    lejean

    Joined:
    Jul 4, 2013
    Posts:
    362
  3. lejean

    lejean

    Joined:
    Jul 4, 2013
    Posts:
    362
    Sigh
     
  4. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    1,775
    Just open the profiler and do some performance tests. I never bothered benchmarking them because I know they aren't very efficient or even convenient to use so I just made my own event system for Animancer.
     
unityunity