Search Issue Tracker
Won't Fix
Votes
0
Found in [Package]
1.0.2
Issue ID
NCCBUG-191
Regression
No
Error "InvalidCastException: Specified cast is not valid" or "Behaviour Index was out of bound" depending on the ordering of the NetworkBehaviour components is thrown when entering Play Mode
How to reproduce:
1. Open the user’s attached project “BugNGOComponentOrder.zip“
2. Open the “Scene Where Bug Happens” Scene in Scenes
3. Enter the Play Mode
4. Observe the Console
Expected result: no error in the Console
Actual result: error "InvalidCastException: Specified cast is not valid" or "Behaviour Index was out of bound" thrown in the Console
Reproducible with: 1.0.2 (2021.3.12f1, 2022.1.20f1, 2022.2.0b12, 2023.1.0a15)
Couldn’t test with: 1.0.2 (2020.3.40f1) (due to compiler errors)
Reproducible on: Windows 10 Pro
Note:
- Couldn’t test in Player because the project fails to build
- There can be two errors thrown: “InvalidCastException” or a "Behaviour Index was out of bounds" error depending on the ordering of the NetworkBehaviour components.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Quest] Pitch Shifter causes audio degradation on Quest 2 devices when sped up
- "GUI Error: Invalid GUILayout" and "NullReferenceException" are thrown when adding Scenes to "Scenes in Baking Set" in Adaptive Probe Volumes
- Inspector window not updating when switching GameObjects in Play Mode while having a VR headset connected
- “UnityException: GetInvalidFilenameChars” errors are thrown, and the Overlay Save Preset button becomes unusable when entering Play Mode with a shortcut while Overlay Save Preset window is opened
- "UnityException: GetName can only be called from the main thread." erors are thrown when the Shortcuts window is opened and entering Play Mode with a shortcut
Resolution Note:
Thank you for reporting a bug to Unity.
We have reviewed the issue carefully, and believe that this issue has been fixed in Netcode for GameObjects version >1.8.1. Please open another ticket if you are still encountering the same issue.