hi,i’ve 3 players and with a menù i can choose one of them,but, in the level the camera don’t follow the selected player.Someone can help me?
make follow script for the camera. As example:
public GameObject Player;
void Update () {
if (Player != null) {
transform.position = Player.transform.position;
}
}
then in the menu, if player was choosed:
public GameObject LevelCamera;
ScriptOnTheCamera followScript;
void Start () {
followScript = LevelCamera.GetComponent<ScriptOnTheCamera>();
}
void ChangeFollowedObjectInTheCameraScript () {
followScript.Player = gameObject;
}
I can’t say how to do it exactly, if I can’t see the game.
thanks,i’ll try ^^