- Home /
The question is answered, right answer was accepted
Can't change script template in Unity 2019.1 (Unity Hub install)
Hello Unity Answers,
So for many many versions of Unity now, I've been able to change my default C# script template very easily. I navigate to this location on my PC:
C:\Program Files\Unity\Editor\Data\Resources\ScriptTemplates
and change the following file:
81-C# Script-NewBehaviourScript.cs.txt
Once I do that I restart Unity and when I go to create a new C# script, it will use my edited template instead of the default one. I upgraded to Unity 2019.1 and now it's not doing that for some reason and I don't know why. A new C# script is generated using the Unity default template but I have no idea where it's pulling that from. I even went so far as to remove EVERY script template from the ScriptTemplates folder, rebooted Unity, then tried to create a new C# script. Not only did it work but it used the default script template still. That means there has to be another location that Unity is reading from but I can't find record of it. Unity's official documentation still says to do it the exact way I've been doing it.
Does anyone have an idea of where I need to go to change my template?
Thanks! -Kaze-
Answer by PixelGuru · Jun 24, 2019 at 10:18 PM
I found the problem. When you install Unity via the Hub, for some asinine reason, it creates a SECOND resources folder within the Hub installation. Buried in there is a resources folder for the version of Unity you have installed and within that is the ScriptTemplates folder that you need to change...why Unity...why would you design it that way?
Does anyone know where exactly this ScriptTemplates folder is? I can't seem to find it. Using Unity 2019.3.11
Hey,
Bit of a dead thread but I did get a notification of your question apparently lol. So I was able to find my templates on my PC here:
C:\Program Files\Unity\Hub\Editor\2019.3.12f1\Editor\Data\Resources\ScriptTemplates
If you have a PC you should find it there too. If you have a $$anonymous$$ac I'm not sure where it is. It does of course require a version of Unity to be installed via the Hub, it can't be just empty. Also note that every time you download a new version, you'll need to replace your template again...kind of annoying but it's fine.