Search Unity

Transform not attaching

Discussion in 'Scripting' started by ItsaMeTuni, Mar 29, 2015.

  1. ItsaMeTuni

    ItsaMeTuni

    Joined:
    Jan 19, 2015
    Posts:
    44
    I'm making a multiplayer game and i have a transform that is the server (wich runs the server scripts), and i'm making a "Reset" key, when i press the key, the player takes the server transform position and teleports to there. My problem is:
    I cant attach the server transform to the variable on my script (wich is in the player prefab), when i hit "apply to prefab" it doesn't work.

    Sorry for my bad english and thanks in advance.
     
  2. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    Scene objects cannot be referenced by prefabs
    You must populate the variable when the prefab is instantiated in script