- Home /
Question by
trinitysj96 · Mar 01, 2013 at 01:41 AM ·
instantiatephotoncamera.main
photon mmo demo cant find camera
I am using the photon mmo demo and have the most of it working right now. however, the label script which puts the username above the player is not working. when you join the room the prefab is instantiated and the main camera is made a child of the photonnetwork.instantiated object.
the problem that i have is that the script on the instantiated object cannot find the main camera now that it is a child of the player.
void Reset ()
// Fallback for the camera reference
{
if (guiCamera == null)
{
guiCamera = Camera.main;
maxViewAngle = guiCamera.fieldOfView * 0.5f;
}
}
the above is the portion where the camera is set.. however this does not work as it cannot find the camera.
any suggestions?
Comment
Do you (still?) have a camera in the scene, and it is tagged "$$anonymous$$ainCamera"?
Yes I do.. however it is when the scene is loaded the "$$anonymous$$ainCamera" is made a child of the player.
Your answer
![](https://koobas.hobune.stream/wayback/20220613093615im_/https://answers.unity.com/themes/thub/images/avi.jpg)