-
Notifications
You must be signed in to change notification settings - Fork 457
Closed
Labels
priority:highThis issue has high priority and we are focusing to resolve itThis issue has high priority and we are focusing to resolve itstat:importedStatus - Issue is tracked internally at UnityStatus - Issue is tracked internally at Unitytype:bugBug ReportBug Report
Description
Description
When a prefab exists in multiple scenes, and then later you add a NetworkObject that that prefab, the instances will have GlobalObjectIdHash collisions in any unopened scenes when you make this edit.
Reproduce Steps
- Open Bossroom sample
- Open DungeonEntrance scene
- Create a new prefab and add two instances to scene and save
- Open DungeonBossRoom scene
- Add two instances of the new prefab to scene and save
- Edit the prefab and add a NetworkObject
- Open Startup scene
- Run game and ready-up into gameplay
- Error will occur
Actual Outcome
"Exception: TestPrefab (1) tried to registered with ScenePlacedObjects which already contains the same GlobalObjectIdHash value 3700887716 for TestPrefab!"
Expected Outcome
Every instance of the prefab would have a unique id.
Netcode needs a way to handle NetworkObject GUIDs (GlobalObjectId) outside of OnValidate() because of issues like this. Netcode also doesn't provide any menu option to re-issue ids to every NetworkObject in a scene and we've had to build that ourselves.
Environment
- OS: Windows 11
- Unity Version: 2022.3.0, 2021.3.11
- Netcode Version: 1.4.0, 1.5.1
Metadata
Metadata
Assignees
Labels
priority:highThis issue has high priority and we are focusing to resolve itThis issue has high priority and we are focusing to resolve itstat:importedStatus - Issue is tracked internally at UnityStatus - Issue is tracked internally at Unitytype:bugBug ReportBug Report