EDIT : I just found how to get any GameObject by tag (GameObject.FindByTag), but I have to get a Camera object and I cannot typecast the GameObject returned in a Camera, Camera derives from Behaviour which derives from Component…
Is there anyway to get a camera by its tag or name ???
Yes, you get the camera object as usual, but to access the camera Component (there’s the hint) you use either the shortcut myObject.camera or use GetComponent.
I have the same access problem to a second camera. It’s tagged but I can’t find a way to access to it by this way.
GetComponent() gets an “Unknown Identifier” error because I’m in a particular case : The prefab which needs to access camera isn’t instantiated at the beginning.
I know I can access to all cameras but I need to send a message to the one with a specified tag. How can I do ?