"Layers could not be found"

I am having some issues with the Raycasting section of your course and I am still having this issue where my script cannot find layer even after re watching and re following your course and zip files :confused:

1 Like

Bump

Have you got the Utility.cs file within your project? This is the file which defines the Layer enum.

1 Like

right.Utility cs. which is include defining Layers as integer help to find Layers in project while you import Camera raycaster on camera.

Iā€™m getting very same issue. For some reason Layer cannot be found by CameraRaycaster.cs
Anybody knows how to fix that?

Hi,

When you say ā€œCannot be foundā€, do you mean the raycast doesnā€™t contact the specific layer, or, you are getting an error in code which indicates the class ā€œLayerā€ cannot be found?

Hey Rob,
turns out it was some IDE issue. i saved project, closed VS, reopened and error was gone :slightly_smiling_face:
i meant Layer class, not specific layer

1 Like

Hi,

Check the version of Visual Studio you have installed. There was an issue with 15.9.2 and Visual Studio Tools for Unity 3.9.02 which didnā€™t reload the project within Visual Studio after changes were made within Unity. For example, the addition of a new script in Unity would not be reflected within Visual Studio. If you opened the script from Unity it would open in Visual Studio but would not be associated with the project and as such had no reference to the other libraries which were required, such as UnityEngine.dll.

Thereā€™s a topic here with details here;

ā€¦but if you do have 15.9.2 then I would recommend upgrading to 15.9.3 which will also upgrade Visual Studio Tools for Unity to 3.9.03.

Privacy & Terms