Search Unity

Question Child Transform as animation event parameter

Discussion in 'Animation' started by rothpletz5, Dec 1, 2021.

  1. rothpletz5

    rothpletz5

    Joined:
    Dec 2, 2020
    Posts:
    27
    Hello,

    I have an animation event that calls a function using a transform as its parameter. my Function essentially looks like:
    Code (CSharp):
    1. public void myFunction(transform childTransform){
    2. //instantiates a gameObject at childTransform.position
    3.  
    4. }
    however, when I call this function as an animation event in the editor, it will not let me drag in a child's transform component into the parameter slot. Same thing if I call it as a gameObject instead. Why is this and how can I fix it?

    Thanks for your Help!
     
    Last edited: Dec 1, 2021