MonoBehavious Isuues

Hello!
I’m trying to code a dialogue manager, following a tutorial I found online since I’m super new at all this and I keep getting the error message “Can’t add script behaviour CallbackExecutor. The script needs to derive from MonoBehaviour!”

According to the tutorial I’m following, the code is MonoBehaviour, so I’m at a loss. Any help in getting this figured out would be great!

Thank you so much!

Did you explicitly indicate that your class inherits from Monobehaviour in the class declaration? The first line after the using statements should look like:
public class CallbackExecutor : MonoBehaviour {
If so, then next thing would be to check your spelling and capitalization.

By the way, you can still write classes that don’t inherit MonoBehaviour in Unity, but you always need to inherit from MonoBehaviour if you want to attach your script to a GameObject as a Component.

1 Like

Thank you so much! I relaized what I was doing wrong.