Synchronizing other Players when they fall in the same group

Options
Hey guys! I apologize if this has been answered already but I have an issue going on currently.

I am working on a spaceshooter multiplayer in Unity and I am in the latest version. I just recently implemented Interest Groups so that only users in the same group send updates. The problem that I am having:

  1. - I have two ships. Ship A and Ship B
  2. - Ship A leaves the interest group of Ship B
  3. - Ship B start shooting infinitely into space
  4. - Ship A moves near Ship B
  5. - Ship A's client doesnt see Ship B shooting though for Ship B's client it is still shooting


How do I let Ship B's client know to synchronize Ship B from Ships A's client? Currently I am avoiding PhotonTargets.AllBuffered for RPC calls so that doesnt help. Wanted to know if there is good solution for this or maybe I am missing something.

Thanks again!

Comments

  • Hi @Jojo,

    how do you do shooting? Is it handled by network instantiate objects or by using RPCs and then instantiate objects locally?

    In general: as soon as one object leaves a certain Interest Group, it won't receive messages from this certain group any longer. As soon as it enters this group again, it will start receiving messages again. However it will only receive new messages.

    This means that in your case Ship A should see Ship B shooting, as soon as Ship A enters the Interest Group of Ship B. However Ship A won't get any updates sent in the meantime. Buffering messages won't help in this case.

    If you want to send messages to all clients in the room, you also have the option to use the default group 0. In this group each client will receive the message, because you can't unsubscribe from this special group.