-
Notifications
You must be signed in to change notification settings - Fork 460
Description
Description
First of all, I’m not a game developer — I just encountered what seems to be a Unity-related issue while playing a certain game.
Let me briefly describe the problem.
This game was upgraded from Unity 2022.3.9 to 2022.3.62f2 to address a Unity vulnerability.
In 2022.3.62f2, the NetworkObject class introduced a new field called m_CachedParent, and that’s where the issue began.
In this game (Lethal Company), there’s a NetworkObject whose default transform.parent is an object in the map scene. When players leave that map, the entire map gets destroyed. The NetworkObject is then brought back to the ship, so it still exists — but its m_CachedParent field becomes a Destroyed state.
When a new player joins the game, SceneEventData.SortChildrenNetworkObjects tries to sort these objects, which leads to an exception.
However, I noticed that SortChildrenNetworkObjects includes a != null check — yet that check doesn’t seem to work properly.
I tried modifying the function, and interestingly, if I simply add a Debug.Log statement inside it, the != null check starts working as expected.
I found this behavior very strange, so I decided to report it.
Reproduce Steps(Use LethalCompany Game)
-
Install any late join mod (e.g., LobbyControl).
-
Start the game, go into the facility, remove the LungApparatus, and bring it back to the ship.
-
Launch the ship.
-
When another player joins the lobby,will an error occurs.
Screenshots
Environment
- OS: Windows
- Unity Version: 2022.3.62f2
- Netcode Version: [e.g. 1.0.0-pre.6]
- Netcode Commit: [e.g. https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/commit/ba418fa5b600ad9eb61fab0575f12fbecc2c6520]
- Netcode Topology: [e.g. Client-Server, Distributed Authority, etc.]
Additional Context
Add any other context about the problem here. Logs, code snippets would be useful here but please also consider attaching a minimal Unity project that reproduces the issue.