Instantiating prefab camera

Hi,

I'm able to instantiate my player prefab and move it around. How do i connect a camera to my player ? When i create the prefab with a camera, the camera itself does not work. A push in the right direction would be appreciated. Eddy.

You can "connect" a camera to a player object in one of two (common) ways:

  • Have a script that "follows" the player by tracking is Transform component.
  • Attach the player to the camera (or the camera to the player) by parenting one to the other (drag one onto the other in the Heirarchy).

Thanks for the push in right direction :)

I found what i needed and it works. This seems to work for me :

if (!target)
target = GameObject.Find("Player(Clone)").transform;

and i had to leave the target unasigned in the editor. Eddy.