- Home /
Should I start instantiating my game objects in Start or Awake function when I load my scene?
Are you trying to set up references between instantiated objects?
soft_sound has the doc links that you should refer to. It looks like Awake is the best bet unless you are getting errors when relying on another instantiation - use Start in that case.
Answer by soft_sound · Apr 07, 2014 at 04:27 PM
"Awake is used to initialize any variables or game state before the game starts. Awake is called only once during the lifetime of the script instance. Awake is called after all objects are initialized so you can safely speak to other objects or query them using eg. GameObject.FindWithTag. Each GameObject's Awake is called in a random order between objects... "
It looks like awake is your best bet for getting references if the references are not dependent on another/order does not matter. What exactly are you trying to do?
Your answer
Follow this Question
Related Questions
Cached references set in awake aren't persisting 0 Answers
when loading a scene, the execution order is load->constructor->finishfunction->awake->start? 1 Answer
FindGameObjectWithTag wont find in Start() or Awake() but will in Update() 1 Answer
ExecuteInEditMode Component construct "twice" and "reset" custom classes 0 Answers
OnEnable, Awake, Start order 8 Answers