Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HelloWorldManager.cs references HelloWorldPlayer #1319

Open
JacobChrist opened this issue Aug 3, 2024 · 1 comment
Open

HelloWorldManager.cs references HelloWorldPlayer #1319

JacobChrist opened this issue Aug 3, 2024 · 1 comment
Assignees
Labels
type:bug Bug Report

Comments

@JacobChrist
Copy link

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();
        //    }
        //}
    }
@JacobChrist JacobChrist added the type:bug Bug Report label Aug 3, 2024
@JacobChrist
Copy link
Author

Also a using HelloWorld; is needed since the HelloWorldPlayer is in a different namesapce (when you get to it in the tutorial).

@jabbacakes jabbacakes self-assigned this Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Bug Report
Projects
None yet
Development

No branches or pull requests

2 participants