[Netcode] Behaviour index was out of bounds. Did you mess up the order of your NetworkBehaviours?

This page summarizes the projects mentioned and recommended in the original post on /r/Unity3D

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Sumo101

  • So I've been following some tutorials online and have been trying to create a multiplayer 3D game, and so far, all I want to do is for two clients to be able to connect to a server, spawn their players (spheres), and move their spheres around and into each other, causing collisions. I have created a player movement script to handle input - just simple WASD and space-jump movement. To handle the networking, I followed Tarodev's Netcode video to set everything up. Here is where the problem begins. Using ParrelSync, I run the game on one editor and a clone on another. I then use a GameObject with the NetworkManager script to start a host on one editor, and a client on the other. Upon connection, the client and host both spawn players, but then the problem begins. As the client's player starts falling down, the host's editor starts experiencing errors and warnings. As mentioned in the title, here they are: [Netcode] Behaviour index was out of bounds. Did you mess up the order of your NetworkBehaviours? [Netcode] Network variable delta message received for a non-existent behaviour. NetworkObjectId: 2, NetworkBehaviourIndex: 2 I did a bit of digging and found that the error was being thrown by a function in the NetworkObject script, but I couldn't really understand why or how to fix it, hence this post. Errors are only thrown on the client when the host moves its player, and errors are only thrown on the host when the client moves its player. The transforms of the players are not being transmitted between host and client at all, despite the player prefab having a Client Network Transform script, and a NetworkObject script. Here is the link to the code if you want to reproduce the error or understand it better: https://github.com/XR101/Sumo101 Any help would be appreciated as this error is driving me insane.

  • com.unity.netcode.gameobjects

    Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.

  • Turns out downgrading Netcode for Gameobjects from 1.0.1 to 1.0.0 is the solution for this. Here's the link for the working version of Netcode: Netcode v1.0.0

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts