#Despawning Players Triggers Warning

23 messages · Page 1 of 1 (latest)

limber wadi
#

Whenever I despawn a player, other clients (not including the host) get the following warning. I'm on 3.11.6.
Spawned NetworkObject was expected to exist but does not for Id 5. This may occur if you sent a NetworkObject reference which does not exist, be it destroyed or if the client does not have visibility.

mortal prism
#

Does the player have an nested network objects?

mortal prism
#

@solemn pecan do you have any ideas about this one, or what we should look for?

solemn pecan
#

I do not but the warning message is most likely correct.

#

It's possible you're destroying the object locally on clients before they get the despawn packet.

#

You can always add debug log to the void destroy on a player script to see the callback of what's taking it out.

limber wadi
solemn pecan
#

Add this...

override void OnStartNetwork() => _theId = base.ObjectId;

then print that in destroy and see if it aligns

solemn pecan
#

Okay, if you override the OnStopNetwork I suppose that is probably calling before the warning?

#

Are you sure another script is not referencing the player and syncing it's object after despawning?

#

EG syncvar containing a script or nob reference of the Id 'not existing'

limber wadi
#

And what would count as a reference to the player "syncing its object"?

solemn pecan
#

Okay so a replicate is coming through after the object has despawned. I am assuming you're using pv2?

limber wadi
#

yes

solemn pecan
#

It's a pretty quick resolve.

limber wadi
#

ok sounds good