Get Camera Look Direction and Center Position when using the PUN Multiplayer Addon

Squill

New member
I need to cast a raycast from the center of each player's camera (to be used for picking up items), however, it looks like only 1 camera ever exists, which appears to be for the host player. I've tried accessing the PunLookSource script, but the direction it gives is not the correct position and it does not take into account the y position when looking up or down.

Am I missing something? I just want the equivalent of each player's camera objects. How can this be achieved? I've searched through many posts and the docs, but can't find anything.
 
The PunLookSource is responsible for syncing the remote cameras. The NetworkLookPosition/Direction are the variables that you want to use.
 
Top