The type or namespace name 'StateMachine' could not be found (are you missing a using directive or an assembly reference?)

I’m getting this issue in Unity even though I’ve already created the class StateMachine. Here are the scripts in question. The error appears regarding this script:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class TestEnemy : MonoBehaviour
 {
     [SerializeField]
     private float turnAngle;
     [SerializeField]
     private float turnRange;
     private float viewAngle;
     private float viewDistance;
     private float speed;
     private float hunger;
     private float hungerSpeed;
     private float maxHealth;
 
     private List<Enemy> predators;
     private List<State> machineStates;
     private StateMachine testMachine;
 
     public float health;
 
 
     // Start is called before the first frame update
     void Start()
     {
         GenerateMachine();
         testMachine.Start();
 
         //testIdle = new IdleMovement("Idle Movement", null);
 
         turnRange = 10f;
     }
 
     // Update is called once per frame
     void Update()
     {
         turnAngle = Random.Range(-turnRange, turnRange) * Mathf.PerlinNoise(Time.deltaTime, 0);
 
         testMachine.Update();
     }
 
     void GenerateMachine()
     {
         IdleMovement testIdle = new IdleMovement("Test Idle", null, gameObject.transform, turnAngle);
 
         machineStates.Add(testIdle);
 
         testMachine = new StateMachine(machineStates);
     }
 
 }

in the same folder, I have the following script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

 public class StateMachine
 {
     public List<State> machineStates;
     public State runningState;
 
     public StateMachine(List<State> machineStates)
     {
         this.machineStates = machineStates;
     }
 
     public void Start()
     {
         StartingRunningState();
     }
 
     public void Update()
     {
         runningState.Update();
 
         EvaluateNextState();
     }
 
     public void StartingRunningState()
     {
         foreach (State state in machineStates)
         {
             if (state.nodeStatus == NodeStatus.RUNNING)
             {
                 runningState = state;
             }
         }
     }
 
     protected void EvaluateNextState()
     {
         foreach (State nextState in runningState.possibleStates)
         {
             if (nextState.nodeStatus == NodeStatus.SUCCESS && nextState.priority > runningState.priority)
             {
                 runningState = nextState;
             }
         }
     }
 
     public void StateDebug()
     {
         string CurrentRunningState()
         {
             return runningState.nodeName;
         }
 
         string NextPossibleStates()
         {
             string nextPossibleStates = "";
             for (int i = 0; i < runningState.possibleStates.Count; i++)
             {
                 if (i == 0)
                 {
                     nextPossibleStates += runningState.possibleStates*;*

} else
{
nextPossibleStates += ", " + runningState.possibleStates*;*
}
}
return nextPossibleStates;
}
}
}
Please help I don’t understand why I’m getting this issue :frowning:

Thanks for the comments! For some reason it’s working now. I did absolutely nothing but it started working after a few hours.