Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Type or namespace could not be found GhostDefaultFile - Unity.Netcode

Discussion in 'NetCode for ECS' started by doingTheCodes, Sep 20, 2020.

  1. doingTheCodes

    doingTheCodes

    Joined:
    Apr 27, 2016
    Posts:
    19
    Hi all,

    following the documentation at https://docs.unity3d.com/Packages/com.unity.netcode@0.0/manual/getting-started.html

    Specifically stopped at the part where
    Code (CSharp):
    1. using Unity.Entities;
    2. using Unity.NetCode;
    3.  
    4. [GenerateAuthoringComponent]
    5. public struct MovableCubeComponent : IComponentData
    6. {
    7.     [GhostDefaultField]
    8.     public int PlayerId;
    9. }
    is supposed to be added as a component.
    When I open this in VS / VScode i get errors that 'Type or namespace could not be found'. I'm not sure I know what i'm doing wrong . I checked the references in Assembly-CSharp and I know that 'Unity.NetCode' is added.

    In the file Unity.NetCode is suggested to be an unnecessary using directive. Can anyone tell me what they think is going on? Thanks
     
  2. florianhanke

    florianhanke

    Joined:
    Jun 8, 2018
    Posts:
    426
    It loos like you're using the NetCode version 0.0.4 getting started – if you're on a later version, here's the 0.3 one: https://docs.unity3d.com/Packages/com.unity.netcode@0.3/manual/getting-started.html (for some reason 0.4 is not up yet)

    From 0.3 onwards,
    [GhostDefaultField]
    is called
    [GhostField]
    .
     
    doingTheCodes likes this.
  3. doingTheCodes

    doingTheCodes

    Joined:
    Apr 27, 2016
    Posts:
    19
    florianhanke likes this.