miwarnec / DOTSNET

Public DOTSNET issue tracker
20 stars 0 forks source link

Changing ownership of existing entities from server #37

Open Radivarig opened 3 years ago

Radivarig commented 3 years ago

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 commented 3 years ago

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;