[Photon] Handling uncaught RPC calls

Hello everyone,

I’m currently making a Combat Arms sort of lobby system.

Basically there’s the lobby to view the available rooms.

When you click on a room you go to the “room” scene, where there’s a UI to view all the available players and theirs statuses, customize your characters and things you do before actually clicking ‘Play’.

There’s also the actual “Game” scene, which you go to when you click ‘Play’.

The way I did this, was by making 2 scenes share the same photon room, but it came with a problem.

When I fire an RPC in the “Game” scene, it’s trying to be caught in the “Room” scene, because the Game scene has photon views to synchronize player spawning and such.

My question is: How can I handle an RPC call that is not caught because there’s no matching method? I want to get rid of the error it throws, without necessarily implementing the method.

Another workaround for it, would be by specifying which photon player IDs receive the RPC (Is that a way to do that?). I have a custom property that tells when a player is in game. This way I would be able to correctly target the RPC.

*I know I can achieve this with an event, but I’d rather do it with an RPC as it looks cleaner.

Thanks in advance!

You could use the RPC overload which takes a PhotonPlayer as a target, and then iterate over all the players to send the RPC to; But personally I would most likely use RaiseEvent myself.