Hi Connor,
This is a minor issue with Unity. The error message is not correct. The issue will be related to your script’s filename and the class name not matching, which they need to, for example;
Example.cs
using UnityEngine;
public class Example : MonoBehaviour
{
// ...
}
The first step to resolve this would be to check both the class name and filename and correct accordingly. Once saved, Unity will try to recompile and if successful, your error will disappear.
If the error persists, and you have confirmed that the class name and filename match, then try the following;
-
within Visual Studio, right-click on the solution and select Clean Solution
-
once complete the console will update to reflect success or failure
-
assuming success, right-click on the solution again and select Build Solution
-
again, the console will be updated to reflect success or failure
-
assuming success, return to Unity and confirm the error has now been resolved
Hope this helps
Got it. Thank you Rob!
Hi Connor,
All working correctly now?
Yes it is!
Fantastic, glad you can move forward again Connor
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.