Hello World Part two - HelloWorldPlayer scripts with errors

Hi all, today I was to trying multiplayer with Unity. I found Netcode and while reading the documentation and doing the Hello World initial project, I encounter a couple of errors. In the HelloWorldPlayer script pop up like 8 errors. I install version 1.0.0-pre.2.

  • Assets\Scripts\HelloWorldPlayer.cs(2,21): error CS0234: The type or namespace name ‘Messaging’ does not exist in the namespace ‘Unity.Netcode’ (are you missing an assembly reference?)
  • Assets\Scripts\HelloWorldPlayer.cs(3,21): error CS0305: Using the generic type ‘NetworkVariable’ requires 1 type arguments
  • Assets\Scripts\HelloWorldPlayer.cs(16,30): error CS0115: ‘HelloWorldPlayer.NetworkStart()’: no suitable method found to override
  • Assets\Scripts\HelloWorldPlayer.cs(10,16): error CS0246: The type or namespace name ‘NetworkVariableVector3’ could not be found (are you missing a using directive or an assembly reference?)

For example in the 2nd error I found that instead NetworkVariableVector3 I should use NetworkVariable…

Where can I found the updated documentation?

using Unity.Netcode;
using Unity.Netcode.Messaging;
using Unity.Netcode.NetworkVariable;
using UnityEngine;

namespace HelloWorld
{
    public class HelloWorldPlayer : NetworkBehaviour
    {
        public NetworkVariableVector3 Position = new NetworkVariableVector3(new NetworkVariableSettings
        {
            WritePermission = NetworkVariablePermission.ServerOnly,
            ReadPermission = NetworkVariablePermission.Everyone
        });
               
        public override void NetworkStart()
        {
            Move();
        }

This is the link to the documentation part
https://docs-multiplayer.unity3d.com/docs/tutorials/helloworld/helloworldtwo#adding-basic-movement-to-the-player-object

Yeah sorry about that, a few things are still out of date in the Hello World. We’ll fix it asap.

1 Like

Thanks for the quick response!

Forgot to answer here, Hello World should be fully working now.

1 Like