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

Instantiating

Discussion in 'Multiplayer' started by mimat18, Jul 26, 2019.

  1. mimat18

    mimat18

    Joined:
    Feb 16, 2019
    Posts:
    12
    If I have a line
    1-instantiate("myprefab")....
    The prefab had a script attached to him will run by instantiating the prefab.
    then line line :
    2-Debug.log("any text");

    My question is :
    I want to know the procedure.
    It will instantiating the prefab then will run the script that attached to the prefab then will run the next line .the debug line .
    Is that right ?
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    When you instantiate a prefab Awake is run immediately. Start will be scheduled to run before the next Update loop. So timing of your Debug.Log will depend on where you're calling it.
     
  3. mimat18

    mimat18

    Joined:
    Feb 16, 2019
    Posts:
    12
    Can you be more clear .
    You mean if I run the instantiating on Awake() the debug will be the last step ..
    What about butting the instantiating on the Start() .