I have a game where you control a ball using W,A,S and D. The Main Camera is following the Player (the ball) using this script:
public class CameraMovement : MonoBehaviour {
public GameObject Player;
private Vector3 Set;
void Start()
{
Set = transform.position - Player.transform.position;
}
void LateUpdate()
{
transform.position = new Vector3 (-280f, 15f, 28f);
transform.rotation = Quaternion.Euler (0.0f, 90.0f, 0.0f);
}
}
}
Now, I made this game multiplayer using LAN. So you can have more players controlling multiple balls in the same time. However, everytime a player joins the LAN Server, a new ball is created from the Prefabs using the Network Manager. The issue is that as you can see in the script, in the single player version I have to connect the gameobject 'Player' to the camera, but when you are running this game in a LAN Server, there is no Player game object, the Network Manager creates one only after a player joined the game. So my question is, how do I connect the camera to each player that's joining the game? Also, I belive that each player has to have his own camera, since he could move diffrently from another player, am I right?
Thanks for the help!