Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question How to sync a scene object with Photon PUN

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

  1. EDevJogos


    Jul 24, 2014
    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


    Jun 16, 2013
    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.