Is there a way to turn off the default creation of "Start" and "Update" functions when you create a new script?

I feel like, the more and more I create my logics inside a game, half the cases i need the Update function and even less the Start one, because either I use OnEnable, Awake or an Init function called by another script, and I also prefer to substitute the Update for coroutines as much as possible, so it’s a bit annoying every time having to delete those functions (and comments like “//Update is called once per frame”… for God sake I already know that!), I feel it like the “standard Blender cube on the scene” that you always had to delete…

Is there somewhere in Unity that I can like tick off “default methods” and create fresh clean scripts?

Thanks in advance

Agree but it’s even more annoying that any new script you create in Unity also recompiles it before you can make your edits in the IDE.

Best get in the habit of creating your scripts directly in the IDE, which may offer more versatile templates too. Good IDEs (read: not from Microsoft) actually provide you with templates for ScriptableObject, EditorWindow, Unit Tests and so forth.

For Unity, there’s a script template file that you can edit but this is part of the editor installation, thus you’d have to make that edit for every editor version you use or install in the future.

2 Likes

You don’t have to do it that way. Refer to this post from the past:

Naming of those files is important. Here is a list of templates I have:
image
Number at the beginning is the menu order - then the name in the Create Menu - then the default file name it creates

Here is how it looks in the projects folder:
image

And here is what it produces in the Create Menu;
image

5 Likes

This isn’t the best explanation but I just tried it and it works. https://4experience.co/how-to-create-useful-unity-script-templates

And you save them as part of the project, they are shareable, etc. Note the diversity available using this system.

1 Like

Agreed! The first compiling time is also annoying and I liked your idea to get used by creating directly inside IDE! Thank you very much :smiley: but for now I’m gonna have a try with ScriptTemplates, I think that would be more useful making as much templates as I want

@tleylan and @iMobCoding

Thank you very much!
Idk why I haven’t thought about that earlier :smiley: it will be far more useful!