Destroy vs PhotonNetwork.Destroy vs instantiate vs photon.instantiate ?

Options

I'm really confused about these things.

What's the difference between just instantiating a gameobject with photonview and instantiating the gameobject to the server with photon view ?

Moreover, what's the difference between just destroying the gameobject with photonview or destroying it from the server. If it has the photonview component, it should get deleted from every player's game right?

Lastly, I'm not sure how, but even with some items I've added to the game, player's are somehow able to interact with them, for instance picking up an item and removing it from the game, even though the item doesn't have photonview nor is instantiated into the server.

Answers

  • Tobias
    Options

    PhotonViews identify networked objects. To instantiate and destroy them properly (so that PUN can keep track of that and also instantiate/destroy on all connected clients), you have to use PhotonNetwork.Instantiate and .Destroy.

    The PUN Basics Tutorial should help get most basic questions covered. There is also a glossary in the docs.