// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.P)) { PlatformerCharacter2D old = playerList[current_player].GetComponent <PlatformerCharacter2D>(); old.unFocus(); current_player = (current_player + 1) % playerList.Count; PlatformerCharacter2D current = playerList[current_player].GetComponent <PlatformerCharacter2D>(); MoveCamera cameraMovement = camera.GetComponent <MoveCamera>(); cameraMovement.changeTargetAnim(playerList[current_player].GetComponent <Transform>(), current); } }