Could not get NetworkObject for the NetworkBehaviour. Are you missing a NetworkObject component?

I want to use this to make a lobby system.When a client create a room, a room will be spawned.The room has a button component, when a client click it, he will join this room.But I clicked it, the error occured.The room prefab has the click event.I think the NullReferenceException result in the error, but I have no idea to solve this.


1 Like

I’m guessing but, does the RoomCreator gameobject have a NetworkObject component, as it looks like it’s handling the click event.

1 Like

Yes,I have found the problem.Thank you.

1 Like