NetworkServer.Destroy(GameObject) disables Client objects instead of destroying them

Hi All,

I’m trying to have a networked (UNET, Unity 5.3.5f1) GameObject be destroyed on the Server and all Clients. I had started with this code, assuming NetworkServer.Destroy(GameObject) would, as it says, destroy the object and all corresponding objects on all Clients.

[Command]
public void CmdAddAmmo(NetworkInstanceId ammoNetID)
{
    GameObject ammo = NetworkServer.FindLocalObject(ammoNetID);
    // Do stuff
    NetworkServer.Destroy(ammo);
}

However, this code correctly destroys the GameObject on the Server, but deactivates the object on the Clients. Now, it’s easy to get around this behavior with an RPC call, but isn’t the intended behavior of NetworkServer.Destroy to destroy the object across the network, not to just disable those on the Clients?

For those interested, here’s my workaround:

[Command]
public void CmdAddAmmo(NetworkInstanceId ammoNetID)
{
    GameObject ammo = NetworkServer.FindLocalObject(ammoNetID);
    // Do stuff
    RpcAddAmmo(ammoNetID);
    GameObject.Destroy(ammo);
}

[ClientRpc]
public void RpcAddAmmo(NetworkInstanceId ammoNetID)
{
    GameObject ammo = ClientScene.FindLocalObject(ammoNetID);
    GameObject.Destroy(ammo);
}

thanks man, work correctly in my project.