Search Unity

Help Wanted How to sync a scene object with Photon PUN

Discussion in 'Multiplayer' started by EDevJogos, May 30, 2020.

  1. EDevJogos

    EDevJogos

    Joined:
    Jul 24, 2014
    Posts:
    70
    I've a game that is like Pong, two players can hit a ball and try to score points by trowing the ball on the other player area.

    Currently i'm using
    Code (csharp):
    1. photonView.TransferOwnership(PhotonNetwork.LocalPlayer)
    depeding on who is closest to ball it will have the ownership of it, the problem is that this call can take over 900ms to complete and the game is fast paced.

    Is there a different aprouch to solve this problem, or a faster way to transfer ownership of a object?
     
  2. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,586
    My approach would probably be to not use a PhotonView on the ball, but to control it instead using RaiseEvent. That way either player can control it without needing to worry about ownership.
     
    tobiass likes this.
unityunity