Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Instantiate not calling start or awake?

Discussion in 'Scripting' started by r1fts, May 18, 2015.

  1. r1fts

    r1fts

    Joined:
    Apr 3, 2014
    Posts:
    4
    Hello,

    I'm creating a gameobject using Instantiate, the object is created fine but has a script on it which should run on awake and start but neither are called.
     
  2. proandrius

    proandrius

    Unity Technologies

    Joined:
    Dec 4, 2012
    Posts:
    544
    You should show the script.
     
  3. r1fts

    r1fts

    Joined:
    Apr 3, 2014
    Posts:
    4
    Ah I figured it out, I wasnt attaching the script to the prefab but to the gameobject.
     
  4. Robotic_Soul

    Robotic_Soul

    Joined:
    Mar 29, 2016
    Posts:
    3
    And the point of this thread is???
    Why don't Mods remove this pointless void?
     
  5. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    It bothered you so much that you had to resurrect it over two years later?
     
  6. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,146
    Pointless void? Honestly, this is a very valid issue. Many new Unity developers forget to attach a script to a gameobject in order for it to work and they come on here asking about it. This person at least attached it to an object, just not to the prefab. Still could help out some people.

    but..as @KelsoMRK said...why resurrect a two year thread and end up bumping it to the front page?
     
    danidina330 and sebastiansgames like this.