Updating a prefab attached to a prefab on instantiation.

At the moment I'm working on a FPS. I have my GUI in the hierarchy, and my Spawn points there also. I have made my player a prefab also since he needs to respawn whenever he is killed. I realised I had to make the GUI and Spawn Points prefabs to attach them to my player prefab, seeing as you can't do that with hierarchy objects.

However, I'm running into another issue now. When I instantiate the player on start up, the GUI or Spawn points don't link themselves to the player correctly.

You could tag your player prefab with a special tag (i.e., "player"). This way, you can use `GameObject.FindWithTag("player")` in order to let the other objects reference the player object.

I have managed to solve this issue, I don't know why it didn't occur to me earlier. You are able to leave the members of the prefab at null, and simply assign them to Hierarchy objects in either the Start() or Awake() function.

you can make them children of the player to instantiate and destroy them with the player if there is no problem with doing this. otherwise you should set the references at runtime. use GameObject.Find and many other functions in Object class and GameObject class to find objects using their name, components and tag. then simplly get the script that you want using GetComponent and set it's variables. you can make objects children of another using transform.parent too. if you use the script to set it's own variables, obviously you don't need GetComponent.