Controlling Perspective on single player.

Somosky

Member
Hi so I'm using UCC with the Pun add on and using both third and first person. I'm attempting the Toggle Perspective determined by which weapon I'm currently equipping. It's working great but I'm running into the issue where it changes perspective on both players not just the one that triggered it. How do I determine which camera is the players vs another players? It seems opsive shares the camera between the players as opposed to instantiating a new camera for every player.
 
The local player will only have the camera. Remote players have the PunLookSource which don't use a camera. You should only call TogglePerspective on your local player.
 
Well right now I'm triggering it through an ability and in the ability I'm finding the camera in the scene and calling togglePerspective on the cameraController and that's triggering it for both players. So are you saying checking to see if PhotonView is mine before calling the togglePerspective?

I'm just confused on how to get a reference to the camera when there is no Photon view on that.

So i guess that's my question. How to get a reference to the local players camera through c#.
 
Abilities are triggered over the network so you shouldn't trigger it there. Instead you should do something like:


Where you use TogglePerspective instead of SetViewType.
 
Top