GenerateAuthoringComponent Namespace?

Noob question:
Why is this code complaining I,m missing a Namespace or Directive ?

 using Unity.Entities;
[GenerateAuthoringComponent]

public struct PrefabEntityComponent : IComponentData {
     public Entity prefabGameobject;
}

What package do i need to install or Using statemen please?

PS I accidentally posted this in Scripting also, Will try to remove it.

Is the code inside an AssemblyDefinition that doesn’t have Unity.Entities listed in its references? Did you just install the Entities package but haven’t restarted the editor yet?

Ahh i didnt restart the editor will try that !

Restarted the editor and VS:Code still reports a missing Namespace/Directive : (

I was watching a CodeMonkey tutorial and he types the exact same thing but gets no error,s but he doesnt say what Packages he,s using in the tutorial (The newest video about converting Prefabs to Entities)

It turns out that I needed to update the Editor to 2019.3 and use Entities 0.5

1 Like