Problems with introducer script

Hello everyone, hope somebody can help me out. When dragging my introducer script on to a object the following window appears, see attachment. I’ve no idea how to fix this, please help :sweat_smile:

Hi Cas,

Does the file name match the class name inside the file? For example, is the Introducer class inside the Introducer.cs file?

Hello Nina,

Thank you for replying!
What do you mean by ‘class name’?
What do you mean by ‘Introducer class’?

According to your screenshot, the class is named Introducer.

image

Is that the reason for the error massage?
What do I have to type to solve it?

Is the script named “Introducer”, too? It must not be named "Introducer " or something like that.

If it is named correctly, please try the following suggestions:

  1. Restart Unity and VS.
  2. Is Visual Studio selected as your External Script Editor in Unity (Edit > Preferences > External Tools)?
  3. Are the Unity development tools installed in VS (Tools > Extensions and Updates)? If they are not installed, go to Tools > Get Tools and Features.
  4. 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:

  1. Reboot your PC.
  2. 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.
  3. Try to update VS.
  4. Try to update Unity.

Did any of these fix the issue for you?

After executing step 3 the problem was solved! I could drag the script onto the object.

I’m a bit puzzled by your message, here’s why:

  1. The script was named “Introducer” because the video told me to do so.
  2. I changed the name of the script and another error message appeared. I named it back into “Introducer” and the error disappeared.

Anyways a big thank you for helping me out! :+1:t2:

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

Privacy & Terms