0

My multiplayer VR project is based on Unity3D, Oculus Integration v1.39 and PUN2 running on Oculus Quest. I'm using the standard teleport script provided in the Oculus library. PhotonAvatarView is what I use to keep avatar position/rotation in sync across clients. Unfortunately, when a player teleports to a new location, the other one doesn't detect any change in the remote avatar. It seems like PhotonAvatarView doesn't see the change in location of the user, which is really strange. How can I fix it?

PhotonAvatarView code is available at this URL: https://doc.photonengine.com/en-us/pun/current/demos-and-tutorials/oculusavatarsdk

Claus
  • 5,662
  • 10
  • 77
  • 118
  • Does it work in general? I mean what happens instead? The other player stays at the position but moves relative to it? Does Oculus move the correct object or do you maybe jave the `PhotonViewTransform` attached to a child/parent object which is not the one moved? – derHugo Sep 28 '19 at 07:20
  • Technically it works well, meaning that the two players (A and B) can see each other moving when they walk in the room. But when A performs a teleport, then B simply doesn't detect the sudden change in location and sees as A is keep on moving in the same location. So basically their reference system goes off-sync and the player positions are not aligned to the room anymore. It doesn't make sense to me as the position of A changes and PhotonTransformView should send the change over the network. – Claus Sep 28 '19 at 11:05
  • Ok thanks for the clarification! Though, is it possible that the teleport is done on a parent GameObject moving the entire character without being synced on the network? Maybe photon only "knows" about the child moved relative to that parent? – derHugo Sep 29 '19 at 07:08
  • It's possible, also I'm using the ExitGames PUN2 PhotonAvatarView which relies upon the Oculus Avatar API for synchronising the position instead of a classic PhotonTransformView which has an advanced configuration for detecting teleport. This gave me an idea: I will write a component which will detect sudden changes in the avatar position between two consecutive frames and will sync that over the network. If it works I will publish it, but of course, if somebody knows a better (and possibly simpler) solution it would be great. – Claus Sep 29 '19 at 10:53
  • @derHugo I can confim your theory was correct, teleport was updating the parent game object so I had to use a separate PhotonView+PhotonTransformView in it to sync the position update. I would convert your comment into an answer so I can mark it as the correct one. – Claus May 09 '20 at 12:45

0 Answers0