Prevent users overlapping when using a Gaze based teleportation system.

Options
Hi

If this has been covered before, please feel free to link me to an appropriate thread.

In the VR app I am working on, I use a gaze based teleportation system. Users can stare at a teleportation zone, it has a list of available seats, picks the first available one, then sends and RPC call to everyone to update their teleporters available positions.

The issue I am having, is if two or more users attempt to move to a teleportation zone at the exact time, they will go to the same location, overlapping.

So I’m looking for the best approach to tackle this issue. I have looked into CustomRoomProperties and (CAS) but have been struggling with the implementation. There clearly needs to be a server side check.

Any help would be appreciated.

Comments

  • Each unique seat/ standpoint have a name, and if it has taken these info should be record in RoomProperties. CAS should be enough for your situation.
    two people fight for the same seat, and only one of people will success because of CAS.
    Hashtable ht = new Hashtable();
    ht["SeatID"] = PhotonNetwork.LocalPlayer.ActorNumber; // or unique nickname
    Hashtable htorg = new Hashtable();
    ht["SeatID"] = null; // no one owned
    PhotonNetwork.CurrentRoom.SetCustomProperties(ht, htorg );
    
  • JamesOra
    Options
    @ThomasKao_XRSpace Cheers Thomas for the speedy reply, I'll quickly test this out and get back to you