#Question about despawning

1 messages · Page 1 of 1 (latest)

marsh coyote
#

Hi I recently upgraded from NGO 2.2.0 to 2.4.4 and I noticed when I call NetworkObject.Despawn() on the server, the object disappears correctly on the server but remains visible on all connected clients.

In 2.2.0, this worked as expected Despawn() on the server removed the object on clients too.

In newer versions the client side destruction does not happen automatically. Is this known? should I stick with 2.2.0 for now?
swift thunder
#

Despawn() hasn't changed. Despawn(false) will leave the gameobject on the server but still destory them on the clients

marsh coyote
#

Okay, so Shouldn't this code destroy the NetworkObject on all clients then? Currently, it only gets destroyed locally (on the host/server), but it remains visible on other clients. The IsSpawned flag is set to false afterward, but the object still exists on the clients. Like I said this only happens with versions after 2.2.0

swift thunder
#

It should yea. You also don't need to destroy it locally. Despawn defaults to true which destroys locally as well.

marsh coyote
#

Yes, after removing the Destroy(networkObject) line it still gets correctly destroyed on the host/server. However for some reason it just won't destroy the object on the clients, it only sets the IsSpawned bool to false. It's really odd and I'm not getting any errors or anything.

swift thunder
#

That is weird. Do you have scene management disabled?

marsh coyote
#

no, it's enabled

marsh coyote
#

I "fixed" it for now by doing this on the network object. Idk what else to do.