Frustrating FPS problem
Options
Hey guys, I'm having a problem that is making me nuts. I have a player, with a camera attached, and a gun attached to the camera. The camera is set in the inspector to be inactive, then when I instanciate the remote player object, I setactive to true for the camera. But the gun doesn't appear. How can I get the gun to appear as well? Thanks in advance.
0
Comments
-
Is the gun by default active?
What does your instantiating code look like?
Is only your camera being set active not the gun?0 -
Yes, it is active by default. The instanciating code is as follows:
Debug.Log("Spawning player"); GameObject pl = PhotonNetwork.Instantiate(playerPref.name, spawnPoint.position, spawnPoint.rotation, 0) as GameObject; pl.GetComponent<RigidBodyFPSWalker>().enabled = true; pl.GetComponent<RigidBodyFPSWalker>().fpsCam.SetActive(true); pl.GetComponent<RigidBodyFPSWalker>().gun.SetActive(true);
No, they are both being set active.
Thanks0