com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

Warnings: "NetworkObject (3) children not resolved to parents by the end of frame"

Open zachstronaut opened this issue 2 years ago • 1 comments

We're spawning a NetworkObject prefab that itself spawns another NetworkObject prefab during its OnNetworkSpawn() and it is this second spawned object which ends up in the OrphanChildren list and issues warnings. We are parenting that second prefab to the first with TrySetParent().

This doesn't appear to break anything in our game. I was reading some of the substantial notes on VerifyParentingStatus() but it's not entirely clear to me if I'm doing something incorrectly in my code.

We do get quite a few of these warnings on the client while it is loading into the game scene from the lobby.

Is this a cause for concern? Perhaps a missing scenario to consider when reworking this code -- as the VerifyParentingStatus() comments suggest y'all intend to do?

zachstronaut avatar Oct 18 '23 15:10 zachstronaut

You might try to extend the NetworkConfig.SpawnTimeout in the event it is taking longer than a second to fully synchronize the client (to make sure that messages aren't getting dropped).

Can you tell if everything is parented correctly when the client finishing loading/synchronizing?

NoelStephensUnity avatar Nov 01 '23 00:11 NoelStephensUnity