Open JacobChrist opened 3 months ago
Describe the bug: HelloWorldManager.cs references HelloWorldPlayer which has not yet been created in the tutorial on this page:
https://github.com/Unity-Technologies/com.unity.multiplayer.docs/blob/main/docs/tutorials/get-started-with-ngo.md
Simply commenting out the body of SubmitNewPosition() allows the script to work.
static void SubmitNewPosition() { //if (GUILayout.Button(NetworkManager.Singleton.IsServer ? "Move" : "Request Position Change")) //{ // if (NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsClient) // { // foreach (ulong uid in NetworkManager.Singleton.ConnectedClientsIds) // NetworkManager.Singleton.SpawnManager.GetPlayerNetworkObject(uid).GetComponent<HelloWorldPlayer>().Move(); // } // else // { // var playerObject = NetworkManager.Singleton.SpawnManager.GetLocalPlayerObject(); // var player = playerObject.GetComponent<HelloWorldPlayer>(); // player.Move(); // } //} }
Also a using HelloWorld; is needed since the HelloWorldPlayer is in a different namesapce (when you get to it in the tutorial).
Describe the bug: HelloWorldManager.cs references HelloWorldPlayer which has not yet been created in the tutorial on this page:
https://github.com/Unity-Technologies/com.unity.multiplayer.docs/blob/main/docs/tutorials/get-started-with-ngo.md
Simply commenting out the body of SubmitNewPosition() allows the script to work.