Object destroy network help-me

hello when I destroy an object on the server with 2 players, it just disappears for 1 player and is still appearing to the other. that is, the object is not to destroying the entire server, only one player as tidy that?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @TyHover,

    How do you destroy objects?
  • TyHover
    TyHover
    edited May 2016
    public GameObject myobject;

    Destroy(myobject);

    I use Inventory Pro and UFPS asset, and use PHOTON UFPS BETA integration.
  • Hi,

    you need to destroy networked gameobject using the following:

    PhotonNetwork.Destroy(this.gameObject);

    AND, its important that it's called when you own the GameObject, make sure you read this:

    http://doc-api.exitgames.com/en/pun/current/class_photon_network.html#a52fdada993f0729be0912113c0ddb3f8

    Destroying networked objects works only if they got created with PhotonNetwork.Instantiate(). Objects loaded with a scene are ignored, no matter if they have PhotonView components.

    The GameObject must be under this client's control:

    Instantiated and owned by this client.
    Instantiated objects of players who left the room are controlled by the Master Client.
    Scene-owned game objects are controlled by the Master Client.
    GameObject can be destroyed while client is not in a room.
    Bye,

    Jean
  • NICEEE, thanks jean. you is fantastic ;)