Search Unity

PUN2 Chess game instantiation problem

Discussion in 'Scripting' started by HarD-izzeR, Jul 21, 2019.

  1. HarD-izzeR

    HarD-izzeR

    Joined:
    Jan 30, 2016
    Posts:
    2
    Hi,
    I made a chess game, it works perfectly in single player and wanted to add a multiplayer mode, so I found PUN2. Originally all chess pieces are instantiated on start, When I tried not to change it, so I just added a photon view and photon transform view classic components and built the game, when I move a piece it shows on one side only. So I tried PhotonNetwork.Instantiate and it worked on both sides well, but it instantiated every piece twice, so there are two white teams and two black teams.. Then I tried PhotonNetwork.InstantiateSceneObject and it didn't instantiate every team twice, and it transmitted the movement on both sides, but I can move the pieces on only one side, on the other client it just doesn't work. Also when using InstantiateSceneObject all pieces have "Controlled Locally" turned off in the photon view component..
    while using PhotonNetwork.Instantiate all pieces have it turned on and on the doubled pieces it is turned off.
    Problem: How can I use PhotonNetowrk.Instantiate without doubling teams. or how can I use PhotonNetwork.InstantiateSceneObject but control the ownership of teams, so that one client owns white team and other owns black team, or even both I think I can work around it if both can control both teams..
    Thanks :D.