In Section 1 part 6 [Introducing Visual Studio] I have run into an error which I cannot circumvent. I have read through similar errors and none of the suggestions or workarounds fix my issue. Any assistance in this matter would be greatly appreciated.
Hi Narosis,
What error did you get? I cannot see any problem in your screenshot.
My best guess is the filename doesnāt match the class name.
No MonoBehavior Scripts in the file or their names do not match the file name is one error & the second error is Canāt add script component āIntroducerā because the script class cannot be found. Make sure there are no compile errors and that the file name and class name match.
From the errors Iām getting you may be correct, but where is the disconnect happeningā¦ why are the filename and class name not matching?
also: on line 10 there is is screwdriver and when I click on it a arrow down menu appears with the āoptionā [for lack of a better term] use expression body for methods
I think maybe just delete that script and create a new one since youāre not too far into it, make sure you delete the file and create the new one within Unity paying special attention to the naming so that Unity can get all the meta data sorted out properly.
Before you delete anything, click the right mouse button in your Assets folder in Unity and click on āReimport allā. If that did not help, try the following:
- Restart Unity and VS.
- Is Visual Studio selected as your External Script Editor in Unity (Edit > Preferences > External Tools)?
- Are the Unity development tools installed in VS (Tools > Extensions and Updates)? If they are not installed, go to Tools > Get Tools and Features.
- Please check if your scripts are included in the project in Visual Studio. Open the Solution Explorer with Ctrl + Alt + L. A dotted icon indicates that the object is not included. If thatās the case, do the following:
- Reboot your PC.
- Close both Unity and VS. Go to your project folder and delete all sln and csproj files. Then start Unity again, double click on the script file inside your Assets folder in Unity.
- Try to update VS.
- Try to update Unity.
Did any of these suggestions fix the issue for you?
Iāve deleted and recreated the file in question MULTIPLE times to no avail so I remain at an impasse.
!. & 5. Done repeatedly.
2. Visual studio IS selected as my External Script Editor.
3. The option to install Unity Development tools NOT available in Visual Studio for Mac.
4. Ctrl + Alt + L does NOTHING in Visual Studio for Mac.
6. Done, same results
7. & 8. Both are the latest versions
NONE of the suggestions worked for me.
Since I mentioned the Solution Explorer, have you already looked for answers on the internet?
That could be the problem. Have you already looked for the option on the internet?
That could also be the problem. For some people Visual Studio 2019 does not work well with Unity. If thatās also the case here, test VS 2017.
Iāve been scouring the internet for solutions since yesterday [starting around 14:00 eastern standard time]
I will ādowngradeā to VS 2017 [IF I can find it] after finally locating the download and installing Visual Studio for Mac Community 2017, I am presented with errors [see Image]
Not only am I confronted with the aforementioned errors, VS 2017 constantly wants to upgrade to VS 2019ā¦ thanks for all your help but I need a break the frustration this is creating is killing my desire to learn.
Ugh! I recently had that bug with my project tooā¦
- Try uh copying all the important stuff in your game in the files folder
- Delete Project
- Make a new one and paste the files to replace all the ones in the new game
- See if it worked because I think it worked for me
- Good Luck and sorry if it doesnāt work but a Good project refresh may work
Tip: Try using VS Code because itās awesome and it works for me
ULTIMATE TIP: DONāT GIVE UP!! KEEP ON LEARNING!!!
I totally get how you feel, happens to all of us but @ErenYeager is right, donāt give up, youāll find the solution soon!
Less frustrated and back at the āgrindāā¦ Following your suggestion I installed VS Code and because of that I direct this query to you,please take note of the attached imageā¦ What do the three (3) ā0 referencesā lines mean?
After installing the latest Unity Editor [2019.3.6f1] and executing āReimport allā, I am happy to report I am able to move forward. Thank [ALL OF] you for your assistance with this matter!!!
Right on! I could be wrong but Iām pretty sure those ā0 referencesā just mean nothing is calling those methods, but visual studio doesnāt know that Unity calls Start and Update.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.