Hi, viewers in this video I am going to show you how you can fix the problem which is can't add script component "Then the script name comes here" because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name matches when you try to add a script component to a GameObject using the inspector window in unity. So, to fix this problem watch this video till the end.
#unity
#getinformationandknowledge
#unity
#getinformationandknowledge
Category
🤖
TechTranscript
00:00Hi viewers, in this video I am going to show you fix for the problem which is that when
00:07you try to add a script component to a game object in unity using the inspection window,
00:15the error pop-ups which is can't add script component and then the script name comes.
00:24In my case, the script name will be GameSpaceInstructions because the script class can't be found.
00:32Make sure that the file name and the class name match.
00:36So viewers, watch this video till the end.
00:40My name is Sajeevan Thanali, welcome to GetInformationAndKnowledge YouTube Channel.
00:44Let's get started.
00:45Viewers, you can see that this is the script named GameSpaceInstructions.
00:53What I will do is just drag this script and then add this script component on a game object
01:02in the inspection window.
01:04You can see viewers that as I dropped it, the error pop-up which is can't add script
01:13component GameSpaceInstructions.
01:16In my case, this is the script name.
01:19In your case, this might be different.
01:23Because the script class can't be found.
01:26Make sure that there are no compile errors and that the file name and class name match.
01:34So what I will do is click on the OK button.
01:39Then viewers, what I will do is click on the script and then right click and then rename
01:47the script name.
01:49Viewers, you can see that there is a space between the two words which are Game and Instructions.
01:58What I will do is finish this space by pressing the backspace key.
02:04Now I will press the enter key and you can see that the hold down pop-up has appeared.
02:11Now the loading has finished and now what I will do is again drag this script which
02:19is GameInstructions and then drop it in the inspector window in Unity.
02:27Viewers, you can see that the script has been added to a game object successfully.
02:35Viewers, hope you like my this video.
02:38If you are new on my YouTube channel, then don't forget to subscribe and click on tab
02:42on the notification bell on all to get the notification of my latest uploaded information
02:46and knowledge videos.