Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Is there a difference in where I attach the Scripts?

Discussion in 'Scripting' started by Kaiwhitehat, Mar 25, 2019.

  1. Kaiwhitehat

    Kaiwhitehat

    Joined:
    Mar 5, 2019
    Posts:
    19
    Hello everyone!

    I am new to unity and already started a little in working with animations and scripts. One thing I noticed, is that for the animation, it did not make any visible difference to me if I added the animation controller to the parent object or the child object.
    Is there any difference whether I attach scripts or animation controllers or something else to the child object instead of the parent object? Or does it not matter at all, since it is the same game object?
    I want to avoid having bigger troubles later on, because I am attatching the scritps the wrong way.

    Thanks!
     
  2. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    That depends entirely on the script. There is no general answer. I also lack experience in animation so I cannot answer specifically for any of the Animation/Animator components.