Please help, base class can't be found in foreach loop

Well you can see where I am looking for FSMStateTest’s below in the for each but they don’t show. No idea what I am doing wrong.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

class FSMStateTest
{
   
}

class ChasePlayerStateTest : FSMStateTest
{

}

class AttackPlayerStateTest : FSMStateTest
{
   
}

public class TestScript : MonoBehaviour
{
    private List<FSMStateTest> myList = new List<FSMStateTest>();
   
    void Start ()
    {
        myList.Add(new ChasePlayerStateTest());
        myList.Add(new AttackPlayerStateTest());

        foreach (FSMStateTest state in myList)
        {
            Debug.Log("WHAY CAN'T I FIND ONE!");
        }
    }
}

That code works fine for me. Remember if you make a script you need to actually drag it onto an object in your scene if you want it to actually run.

Totally did dude. I am not a bubble gummer.

When I run it and step over it in visual studio it never hits the part where it says “WHAY CAN’T I FIND ONE!”

I am baffled! I think this is gonna be a major head knocker for me. Gonna start a new project and see if it fails there.

Edit: Fresh project does not work on my computer, crazy environment issue, hmmm. Tell me this works for everyone else so I know I am not crazy!

2944149–217955–TestUnityThrowAway.zip (28.5 KB)

Works here. You might want to verify that you have the right-most toggles enabled just in case they got switched off.

2944271--217964--works.png

I’ve had more than one case of simple, clearly correct code that simply didn’t run right in Unity until I exited and restarted and forced a rebuild. In one instance I did this many times before it mysteriously started working again. (It isn’t worth the effort, but if you searched all my posts you’d find a couple of hair-puller threads like this.)

I know this isn’t much help, but sometimes either Unity or Mono just flakes out like that.