C# Unity Game Development 3D "Chapter 2" Error on C Script before I even start,

,

Yes i have a question about a course that I am working on at this time. Complete C# Unity Game Developer 3D My problem is in the second chapter where we are making the Hacker Terminal and my problem comes in when I just get started with making my first C# script for this Hacker Terminal, I’m naming this C File “Hacker.cs” like I’m told well right away i have a error well really 3 errors. So when i try to drag the script over to WM2000 that i put in my , Hierarchy section it tells me this [" Can’t add script "] {“cann’t add script component ‘Hacker.cs’ because the script class cannot be found . Make sure that there are no compile errors and that the file name and class name match”} Ok and this is before I have done anything to this file besides giving it a game. I have been trying to troubleshot it myself I renamed the file to see if that helped , I wrote the code out saved and tried , I have deleted the Hacker Terminal files and re did that . I uninstalled Unity . So my next step is to reinstall windows 10 lol. But figured I see if I could get some help as to why this is happening Thanks

Hi Stephen,

Does the file name match the class name inside the file? For example, is the Hacker class inside the Hacker.cs file? Does MonoBehaviour have the same colour as your classname? If not, there might be a problem with Visual Studio. Please watch lecture “Fixing Visual Studio Problems” (currently #7).

If there are any error messages in your console, please compare your code to the Lecture Project Changes which can be found in the Resources of each lecture.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms