Destroy GameObject through ServerRpc

Hi,

I am very new to Netcode and it’s my first time using it, just a heads up.

I want a client to press a button and upon that a tree (a GameObject) should be destroyed.
The problem here is, that the tree is a NetworkObject and I want it to be destroyed on all clients.
The call to destroy the tree should be made by a client though, but clients are not allowed to destory NetworkObjects. So I would send a ServerRpc and let the server destroy it.
Now, how do I let the server know which GameObject it should destroy. Server RPCs only take non-nullable types as Parameters, so I cannot just pass the GameObject or the Transform of my tree as a Parameter for the RPC.
I have multiple trees in the scene.

Thanks for your help in advance.

You can pass it as a NetworkObjectReference or a NetworkBehaviourReference, whichever is more convenient.