Search Issue Tracker

Won't Fix

Won't Fix in 1.0.X

Votes

4

Found in [Package]

1.0.0-pre.6

Issue ID

NCCBUG-146

Regression

No

Behavior index was out of bounds exception thrown when compiling a change for the first time

Package: Multiplayer Netcode for GameObjects

-

How to reproduce:
1. Open the attached project "TestProject.zip"
2. In the Clones Manager window which is under "ParrelSync" in the Menu bar click "Create new clone" and select "Open in New Editor" after the clone loads
3. In both Editors Open Scene "FirstScene" and enter Play Mode
4. Modify Script "TestClass" by adding a space or a comment and focus on both Editors for recompilation
5. In the cloned, "Client" Editor observe the Console

Expected result: Client Editor doesn't throw any errors
Actual result: Client Editor Console logs error

Reproducible with: 1.0.0-pre.6 (2020.3.32f1, 2021.2.17f1, 2022.1.0b14, 2022.2.0a8)
Couldn't test with: 2019.4.31f1 (No Package for this stream)

Error:
\[Netcode] Behaviour index was out of bounds. Did you mess up the order of your NetworkBehaviours?
UnityEngine.Debug:LogError (object)

Note: No error is logged after recompiling and making changes again

  1. Resolution Note:

    There are no fixes planned for this Bug

  2. Resolution Note (1.0.X):

    Netcode for GameObjects does not support making changes to NetworkBehaviour script files during runtime.

Comments (3)

  1. Baldor

    Sep 15, 2022 15:38

    in my case the reason was the function OnNetworkSpawn. Ive removed it and it works now.

  2. Baldor

    Sep 15, 2022 15:11

    same issue here. ive tried multiple Editor Versions too but no luck...

  3. Seforius

    Aug 27, 2022 06:58

    Similar issue here. Upon starting host and client on different editors - one being a ParrelSync clone - editors are able to control their own player prefabs but no information is sent between client/host and the same error: did you mess up the order of your network behaviors? is shown. Would appreciate a response.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.