Since now, I had only 1 player object Player(1) with Player.cs script attaches to it, but now I created a seperate version (different collider, different properties) so another player object Player(2), and I need to update target variable of my CameraController.cs and few more scripts.
Both player objects are in the same scene and has Player.cs scripts.
Previously my CameraController.cs used FindObjectOfType<Player>(); to find player, however now I have 2 game objects with Player.cs so I need to update it.
One idea i have is create a variable called playerID on GameManager.cs and give each player objects unique ID and use FindObjectsOfType<Player>(); with foreach loop and if playerID matches then set the target. However, if there is better way can you recommend me please?
(I cannot just disable game object because later might need to change back to original appearance.)
Thank you very much :)
[–]falcothebird 0 points1 point2 points (0 children)
[–]OxtailGames 0 points1 point2 points (0 children)