Unity-Technologies / com.unity.multiplayer.docs

Open Source documentation for Unity Multiplayer, which includes Netcode for GameObjects, the Unity Transport Package, Multiplayer Tools and Educational references and Sample Games such as Boss Room.
https://docs-multiplayer.unity3d.com/
Other
654 stars 201 forks source link

Feedback for docs/tutorials/get-started-with-ngo.md #1328

Closed hanghoo closed 1 month ago

hanghoo commented 2 months ago

Hi there,

When I copy the provided code into the HelloWorldManager.cs script, Unity Hub prompts errors as follows: Assets\Scripts\HelloWorldManager.cs(34,43): error CS0120: An object reference is required for the non-static field, method, or property 'HelloWorldManager.m_NetworkManager'

Do you have any suggestions for figuring out this issue? Thank you very much.

hanghoo commented 2 months ago

After I added a static for private NetworkManager m_NetworkManager;, then the error disappeared. Do you think the solution is correct? Thank you.