Search Unity

Calling Child component fuctions in animation Event

Discussion in 'Immediate Mode GUI (IMGUI)' started by SinisterMephisto, Mar 31, 2011.

  1. SinisterMephisto

    SinisterMephisto

    Joined:
    Feb 18, 2011
    Posts:
    179
    I was wondering is there was a way to call child functions during animation events.
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    I'm not sure what you mean by child functions. Functions on child objects? Perhaps you could explain what you want to do with the animation events.
     
  3. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    You can only call functions on the root of an animation. In our games, this leads to specialized scripts that pass the call to the appropriate child.
     
    Argenuto and LordSandwiches like this.
  4. SinisterMephisto

    SinisterMephisto

    Joined:
    Feb 18, 2011
    Posts:
    179
    @Daniel thanks alot.

    @Ande i meant callign the function a child object from its parent animation
     
  5. MadboyJames

    MadboyJames

    Joined:
    Oct 28, 2017
    Posts:
    262
    Old post, Is creating a script on the root to call the script on the child still the best practice?
     
    ManuelHuber and EZaca like this.