Is there a way to stream data to only one player/target?
Options
Hi,
In my game when 2 players talk with each other I want to sync some real-time data between them, but only them - other players in the room don't need to receive (to save bandwidth). However, some data is always sent to everyone. Is there a way to have OnPhotonSerializeView send data only to a specific target? Maybe using the info parameter. The other option I was thinking of is sending a bunch of unreliable RPCs to that specific target. Will this work?
Thanks.
In my game when 2 players talk with each other I want to sync some real-time data between them, but only them - other players in the room don't need to receive (to save bandwidth). However, some data is always sent to everyone. Is there a way to have OnPhotonSerializeView send data only to a specific target? Maybe using the info parameter. The other option I was thinking of is sending a bunch of unreliable RPCs to that specific target. Will this work?
Thanks.
0
Best Answer
-
Hi @infinityx,
you have multiple possibilities to achieve what you want to have. The first one is working with interest groups. You can read about them in the related documentation page. Another option you have is to use the RaiseEvent function. This has the advantage, that you don't need a PhotonView component for communication between two clients as you would need when using RPCs. You can also define, who will receive the message you are going to send next. How this work is described in the RPCs and RaiseEvent documentation page.5
Answers
-
Hi @infinityx,
you have multiple possibilities to achieve what you want to have. The first one is working with interest groups. You can read about them in the related documentation page. Another option you have is to use the RaiseEvent function. This has the advantage, that you don't need a PhotonView component for communication between two clients as you would need when using RPCs. You can also define, who will receive the message you are going to send next. How this work is described in the RPCs and RaiseEvent documentation page.5