Can you have multiple MonoBehaviors in the same script file?

I made a C# file with three MonoBehaviours in it: a base class and two that inherit from the base. When I tried to attach one to a game object in the Editor, the only one that appeared in the list of components was the base class. When I created a separate C# file for each of the child classes, then they appeared in the components list.

It’s not a big deal. I’m just wondering if it’s possible to have multiple MonoBehaviours in the same C# file for convenience.

Well, you can definitely create mulitple monobehaviours in the same file, but when you add the file to the game object, only the top-most behavior in the file will show up in the Inspector.

Generally, nobody makes multiple monobehaviours in the same file. You have to always create them in the separate files to be able to use them.