Can I add custom classes in a plugin script?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Skelteon

I’ve created a plugin that adds a custom node which also requires a custom class. I wasn’t able to use the custom class when the script for the class was in the same addon folder, so I just made it an inner class on the custom node’s script.

It works as-is, but i would really rather pull that code out into its own script so the script files aren’t as bloated.

Is this possible in plugins?

:bust_in_silhouette: Reply From: Skelteon

This actually seems to have taken care of itself. I think it was just a weird issue with Godot cacheing the class and not updating properly.

I did also add extends Reference to the top of the custom class, but idk if that was “the fix”. I suspect everything was fine and this was a false alarm.