Unity - Synchronization problem

Hi. I develop online soccer shooting game with with using Photon Network. Two players, will be goalkeepers respectively and will shoot each other.
For example:
Player A: Shooter
Player B: Goalkeeper

Players will change after player A shot the ball. So it will be like this:
Player A: Goalkeeper
Player B: Shooter

The goalkeeper and the shooter objects are already on stage and attached PhotonView component(I do not instantiate later these objects). At first; Player who created the room is shooter and other player is goalkepper. The problem starts here.
Local players can move their own objects(goalkeeper and shooter object) but there is a problem on global.The first player(Shooter) is can do it moving the Shooter object on local but other player sees the shooter object still(stationary). But second player(goalkeeper) when move the goalkeeper, The first player can see it. So, the first player's movements are not synchronized. There is no problem in the second player.
When I look at the photonview component of the Shooter object from the editor, I saw "Owner" value is "scene" in the local and global(Same object ama in the other player game). I think this is the problem. Because when I look at the photonview component of the goalkeeper object, I saw the owner is other player photon player name..

Sometimes this is the exact opposite(no problem in the first player but the second player has problem).

Could you help me? Thanks
Note: I am using Unity3D Game engine
(Sorry for my bad english)

Answers

  • Hi,
    First of all, as you said, 'Owner' should not be 'Scene' to be synchronized.
    How did you instantiate those Shooter and Goalkeeper prefabs for each player?

    Anyway, the way I recommend for your game is:
    - Master Client instantiates both Shooter and Goalkeeper using PhotonNetwork.Instantiate(...).
    - You can transfer the ownership of PhotonView, so you do it for other player.
Sign In or Register to comment.