Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Find GameObject that script is attached to?

Discussion in 'iOS and tvOS' started by aerende, Jul 6, 2010.

  1. aerende

    aerende

    Joined:
    Apr 27, 2009
    Posts:
    316
    If I have a script attached to a PreFab and the PreFab is instantiated multiple times, how can I within the script obtain the Game Object that the script is attached to?
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,602
    this.gameObject
     
unityunity