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
Bump
Have you got the Utility.cs file within your project? This is the file which defines the Layer
enum.
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
i meant Layer class, not specific layer
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.