// In first OnEnable isLocalPlayer is not set yet. private void Start() { if (!isLocalPlayer) { return; } cameraFollow = Camera.main.GetComponent <Camera2DFollowMany>(); cameraFollow.AddPlayer(gameObject); }
void OnEnable() { cameraFollow = Camera.main.GetComponent <Camera2DFollowMany>(); cameraFollow.AddPlayer(this.gameObject); }