Search Unity

Netcode doesn't exist in the namespace 'UnityEngine'

Discussion in 'Netcode for GameObjects' started by deadlyshun01, Feb 24, 2023.

  1. deadlyshun01

    deadlyshun01

    Joined:
    Jan 29, 2023
    Posts:
    1
    I'm a newbie. I'm stuck with this error since yesterday. I'm getting error with this specific line of code. Help!

    using UnityEngine.Netcode;//Here is the line of code where I get error.

    Here's the error:
    Assets\NetworkManagerUI.cs(5,19): error CS0234: The type or namespace name 'Netcode' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)

    I've tried removing and reinstall the "Netcode for GameObjects". I add multiplayer tools in package manager. Tried upgrading the version of my unity editor too. Lastly i tried reimport but I can't find reimport in external tools in preferences. Anyone know how to fix this?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,882
    Code (CSharp):
    1. using Unity.Netcode; // not: UnityEngine
    Packages provided by Unity use the Unity namespace.
    Built-in APIs use UnityEngine respectively UnityEditor namespaces.