Problem with Adding Hacker Script to WM2000

38%20PM

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
    image

  • once complete the console will update to reflect success or failure
    image

  • assuming success, right-click on the solution again and select Build Solution
    image

  • 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 :slight_smile:

Got it. Thank you Rob!

1 Like

Hi Connor,

All working correctly now?

Yes it is!

1 Like

Fantastic, glad you can move forward again Connor :slight_smile:

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

Privacy & Terms