My player has the UI attached to it and it functioned fine until I added the network manager script from Netcode For GameObjects. When I press the host button to load the player prefab and network the error persists and no player or camera is loaded.
If I add the player to the scene and then use the GameView to test, and it all works fine. The error only persists when I begin the network, so I assume it is to do with me not including some Netcode script to handle the UI in the network.
I am very new to this so apologies if this is a very simple solution, none of the solutions I have already found have helped so anything will be greatly appreciated thanks.
Edit: For some reason removing a function that wasn’t related to the GUI fixed my issue. I still have no idea why it was broken but everything works now
I forgot to mention that the code was copied from the learn Netcode site:
void OnGUI()
{
GUILayout.BeginArea(new Rect(10, 10, 300, 300));
if (!NetworkManager.Singleton.IsClient && !NetworkManager.Singleton.IsServer)
{
StartButtons();
}
else
{
PlayerControl();
}
GUILayout.EndArea();
}