#I keep getting an error with my raycasting

1 messages · Page 1 of 1 (latest)

edgy moon
#

I don’t know much C# but maybe a semi colon after raycastscript.update()

sage coral
#

The most likely issue is that you have no camera tagged Main Camera in your scene. Hence, Camera.main will be null.

sage coral
dreamy kettle
#

First off

#

[]ioc

wispy nexusBOT
#

An image of your code is not helpful

When asking a question about a problem with code, people who are volunteering to help need the text of the code. Unless you are asking about your IDE - and not the code itself - images of the code are not an acceptable substitute.
Source: https://idownvotedbecau.se/imageofcode

Please send your code as a codeblock. If you don't know how to send a codeblock, type []cb.

dreamy kettle
#

Second, which line is line 22

#

Third

#

[]noint

wispy nexusBOT
#

How to deal with no VS intellisense problem:

If you have opened script and see Miscellaneous Files in place where should be name of your project (see screenshot below) it means that the file was not correctly loaded into project or you don't have any project loaded. Follow these steps to fix this:

  • Unity tools and Unity IDE preference - make sure to install the Unity Tools in your VS Installer and check the Unity preferences Edit - Preferences - External Tools and verify that the right External Script Editor is selected (you want Visual Studio there).
  • Reload project - View - Solution Explorer right click on project and click Unload project then right click on it again and load it again. If you don't see any project in Solution Explorer then move to the next step.
  • Regenerate solution files - Remove the .sln and .csproj files from root of your unity project (in File Explorer), they will be regenerated next time you open script from Unity.

How to deal with no VSCode intellisense problem:
Follow the guidelines on this page:
https://code.visualstudio.com/docs/other/unity

https://cdn.discordapp.com/attachments/545801512173961239/553525896045133826/unknown.png