Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
32
Question by Johan 4 · May 24, 2011 at 08:43 AM · defaulttemplate

Change the default script template?

Is it possible to change the default template that unity uses to create a script? Thanks

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

5 Replies

· Add your reply
  • Sort: 
avatar image
61
Best Answer

Answer by Bunny83 · May 24, 2011 at 09:50 AM

Sure you can ;)

Just go into your Unity-installation-folder and navigate to "/Editor/Data/Resources/". There you will find all templates.

  • NewBehaviourScript.cs
  • NewBehaviourScript.js
  • NewBehaviourScript.boo
  • NewShader.shader

And even UnityObject.Source.js and UnityObject.js that are used in the webplayer's html page.

Comment
Add comment · Show 13 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DayyanSisson · Nov 21, 2011 at 02:09 AM 1
Share

How do I find the installation folder? I'm using a $$anonymous$$ac. I tried looking through the package contents, I even did a search of my whole computer, and I couldn't find it.

avatar image Adrian · Feb 22, 2012 at 03:23 PM 5
Share

On the $$anonymous$$ac they are in the Resources folder inside the app package. The full path is /Applications/Unity/Unity.app/Contents/Resources, hit Command-Shift-G, paste this path and hit Open. This should get you into the folder (if you haven't renamed the Unity folder).

avatar image Adrian · Feb 27, 2012 at 07:43 AM 1
Share

That's probably a permission issue. Either use a text editor that properly asks for ad$$anonymous$$ permissions when needed (e.g. Text$$anonymous$$ate does this) or try copying the file to the desktop, edit it there and then copy it back.

avatar image MFen · Jun 04, 2014 at 02:18 PM 1
Share

I had to log in as ad$$anonymous$$istator, rename the old one and name new one the correct name, there was no way to edit the current one directly.

avatar image klesun · Sep 11, 2016 at 08:56 PM 1
Share

Path slighlty changed over years. Windows 7, Unity 5.3.6f1: C:\Program Files\Unity\Editor\Data\Resources\ScriptTemplates\ Btw, see the answer to this question to define magic keywords

Show more comments
avatar image
17

Answer by NateJC · Apr 22, 2012 at 09:37 PM

As of Unity 3.4, they are now located here (Mac):

/Applications/Unity/Unity.app/Contents/Resources/ScriptTemplates/

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image kot-behemoth · Feb 19, 2013 at 11:37 AM 1
Share

Same for Unity 4.0/4.1

avatar image
6

Answer by dylan16hl · Jan 22, 2015 at 05:12 AM

For Unity 4.3 on PC it is

C/E/F:/Program Files (x86)/Unity/Editor/Data/Resources/ScriptTemplates

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
5

Answer by zak-reynolds · Sep 23, 2015 at 07:10 PM

If anyone is using the new Linux editor and wondering where these templates are located, you can find them in the following directory:

 /opt/Unity/Editor/Data/Resources/ScriptTemplates

You'll probably need to go root to modify them, but it works!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
5

Answer by jura_wd · Nov 16, 2018 at 07:04 PM

1) Create Assets/ScriptTemplates to override built-in templates on a per-project basis. 2) Reopen the project

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Thomas-Bousquet · Feb 05, 2019 at 05:14 PM 0
Share

This actually works! Unity won't put the default files there, so you've got to copy the ones you want to override from the folders mentioned above.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Change Default Script Folder 5 Answers

How can i change the default new scene? 1 Answer

New Project/Scene - Change Default Settings? 2 Answers

How do I change the default script heading? 0 Answers

Editor Script Reverts to Default State on Script Compilition 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges