I have a multiplayer game and the Main Camera is disabled.
Each Player has it’s own Camera component attached to it with a script called PlayerController.
Each Player has a child script component which needs to access its mouse position.
I access then the parent camera like this:
GameObject playerCamera = transform.parent.GetComponent<PlayerController>().plCam;
But I am having problems trying to calculate its mouse position:
Vector3 mouseWorld = playerCamera.GetComponent<Camera>().main(Input.mousePosition);
It says Camera.main is not callable.
The problem if I just use Input.mousePosition it’s the position is not relative to the Player.
I have the player camera tagged as main and active and enabled, I dont know if I am missing something else.