In UFPS (Ultimate FPS) the Camera(s) are attached to an Empty, which is then connected to the player prefab, if you separate them, you get a tonnnn of bugs popping up, in other words, the camera is hard-coded to always be attached to the player prefab.
The reason this is an issue for me, is Photon. Every guide I come across shows how to set this up, with the camera being a standalone thing. So, I'm not sure if this is even possible, cause I'm new to all this.
Here is how it's normally done:
GameObject playerObj = PhotonNetwork.Instantiate("PlayerPrefab", new Vector3(114f, 105f, -90f), Quaternion.identity, 0);
vp_FPCamera camera = playerObj.GetComponent();
camera.enabled = true;
So, my question is, is it possible to code something to look at a sub-object component, instead of the base level of the object?
I have PlayerPrefab > FPSCamera > vp_FPCamera script component. My current code above only looks at PlayerPrefab for 'vp_FPCamera'.
Any help here would be greatly appreciated. Thanks. :)
↧