Monobehaviour error in ActionScheduler.cs

I get this error: Assets/Scripts/Core/ActionScheduler.cs(7,9): error CS0246: The type or namespace name ‘Monobehaviour’ could not be found (are you missing a using directive or an assembly reference?)

my code:

using UnityEngine;

namespace RPG.Core
{
    public class ActionScheduler : MonoBehaviour
    {
        Monobehaviour currentAction;

        public void StartAction(MonoBehaviour action)
        {
            print("Cancelling" + currentAction);
            currentAction = action;
        }
    }
}

It’s in the line

Monobehaviour currentAction;

CSharp is case sensitive, so it needs to be

MonoBehaviour currentAction;
1 Like

Oh wow, I didn’t see that…!

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

Privacy & Terms