Problem with Adding Hacker Script to WM2000

cu2_s02_terminal_hacker_game_design

#1

38%20PM


#2

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:


#3

Got it. Thank you Rob!


#4

Hi Connor,

All working correctly now?


#5

Yes it is!


#6

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


#7

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