Bugs that only appear when I "build & run"?

So I have this dialogue system. This is what the script looks like:

The dialogues are stored in .asset files, this is what they look like in the project folders:

This is what it looks like when I edit the dialogue:

In the interactables in my game I just drag the dialogue and handle them inside the script, this is what it looks like in the inspector:

Everything runs perfectly when I just run it inside of unity, but when I do “build & run” this happens:

If you know what this problem is and how to fix it please respond. If you need more information from my project I’ll be sure to reply with it. THANK YOU!!!

The Script None bit in the Inspector certainly is odd and is the source of your issue.

First thing to try - I believe MonoBehaviours and ScriptableObjects need to be in their own files and the filename has to match the class name.

2 Likes

“MonoBehaviours and ScriptableObjects need to be in their own files and the filename has to match the class name.”

I don’t quite understand what you mean there, is it not supposed to be “.asset” files? I wrapped the script in a ScriptableObject now, this is what it looks like:

Make a file called Dialogue.cs and put your Dialogue scriptableobject in it with nothing else.

YES!! I got it working now! Thank you so much for the help.