I teach Unity a lot. Whenever I have an intro course, the first thing my students see is the default Unity project – which, to me, has some issues. So a good chunk of the first workshop is taken up with setting up the project correctly. I know I can make a sample project, and distribute that project, but there's something unsatisfying about it. I want to be able to have a good, clean template available from Unity Hub.
Here's how to make that template.
Setting up the project
Unity Hub templates are just Unity projects, with some edits. So the first step is to create a Unity project. Make sure you're using the version of Unity you want to make the template for.Next, in Unity, set up everything you want set up. In my case, I like to make the project directories, add some packages, and the like.Make a note of the path to the default scene you'd like to have in the template. You'll need it later.
Save your project.
Setting up the template
Now we'll need to turn the project into a template. I like to make a copy of the project, so I have a full version to make edits to.
In the new copy, remove all files and directories except for
Next, change the name of the project directory to
ProjectData~, and put it into a new directory called
package.json.The basic contents of this package looks like this:
"description": "Use this template in Massey courses.",
ProjectVersion.txt. It makes Unity Hub barf if it's still there.
ProjectSettings/ProjectSettings.asset, edit the
templateDefaultScenelines as needed.
Creating the template archive
tar czf com.unity.template.massey-0.0.1.tgz package/
and on Windows I believe its:
where the version number changes as needed.
And that's it! Check to see it in action: