Scripts without gameObjects

Hi all.

I’m just wondering what you all do for general functions that don’t really “belong” anywhere.
i.e. it’s not really suitable to attach them to a gameObject.

Can a script just be created in the project (and not added to the hierarchy), and then have its functions called by other scripts and gameObjects?

Are there any pitfalls with this approach?

Or do I need to create an empty “scene manager” gameObject that can hold such scripts?

Thanks for any advice.

Yeah its fine, just use import myscript; in the scripts that do use them, or prefix the scriptname of the static function (they have to be static in this case) ie: utils.CalculateNormals(mesh);

Excellent, thanks!

Just wondering though - if I were to use:
Import myScript;

Would that have any overhead?
i.e. would the script that is being imported into actually become bigger behind the scenes, in terms of memory use?

I’ve no idea. I use about 50 of them. Increases compile time a tiny amount. If it becomes a problem I’ll just prefix the name in front of the function call.

Cool, thanks for the tips!