DOTSNET icon indicating copy to clipboard operation
DOTSNET copied to clipboard

Changing ownership of existing entities from server

Open Radivarig opened this issue 5 years ago • 1 comments

I'd like to implement item pickup/drop system and am trying to change networkEntity.owned state of an item entity. I tried to call

server.Unspawn(itemEntity)
server.Spawn(itemEntity, connectionId)

but the item is just unspawned, even though the call is completed. Even if that worked it would still remove existing entity while ideally I would like to just change the owner, so the feature of having the existing entity change owner from server side would be nice.

In the meantime I could use any workaround available.

Radivarig avatar Oct 25 '20 00:10 Radivarig

Also I tried to use int? networkEntity.connectionId of the player entity from the client but it is not set, I assumed it would be available from the client? It is used by the interest management system like this:

bool owned = networkEntity.connectionId == connectionId;

Radivarig avatar Oct 25 '20 02:10 Radivarig