PHOTON: CAMERA TRANSFORM OF OTHER PLAYER

Dear All,

I think it is an easy question but i cannot find a solution to this(

I want to get transform of other player’sCAMERA over the network.

i.e:
Whenever a user clicks on the screen; A gameobject should spawn regarding to the camera of the other user!

Pseudocode:

if (Input.GetButtonDown("Fire1"))
{
    Instantiate(xGameObject, (CAMERA TRANSFORM OF OTHER USER), Quaternion.identity)

Hey there,

easiest solution: create 2 RPCs.

They should look something like this:

Player A sends an RPC to Player B. Something called requestTransformfor example.
Player B packs his Camera.main position and Rotation into another RPC which he sends back to Player A. Then you can use this information for your instantiation.

Careful here: since PhotonTargets does not have an option to send an RPC to only one specific player you will always have to send the request and so on to everyone else. Which is dumb but the most easy way. So only do this when you have lets say 4 players or less. Otherwise you need a different system.

Let me know if that was unclear or you need further help on this.