It’d be great if we could set up our own templates, so that we can jump-start new projects to match our own workflows.
For example, if I always use a certain set of assets, with a couple of prefabs for customized character controllers, quality settings, etc… I can start a new project with the Schneider’s Startup template and have a few days work already done for me.
This is the value I’d find in templates. Getting a basic 2D/3D setup I still have to do a lot of work for isn’t all that exciting to me.
Seconding this. I’m thinking especially for easily scaffolding projects, but also being able to more easily facilitate modding workflows that use the Unity editor for their main modding platform. Things like Sky Rogue, Cities Skylines, and others would be much benefited from being able to just provide a Unity template that people can use to easily get started modding without needing to import additional packages and configurations.
Seems like the best way for this may just be to setup a project how you want the template to be. Then either from inside Unity or from the hub itself (having to save and close the project most likely) have a “Create Template” option that will create a custom template off the current Unity project.
I already do this. The problem is the project may contain old versions of the assets whereas I see the template maybe installing the current version of the asset. I literally just found out about the hub beta, so I’m not sure if that is the case but that is how I hope/assume it works.
I also would like to jump on the bandwagon with this request. It would be awesome if we could setup our own templates to use here.
By looking a bit around the Unity folders I found this folder inside latest beta version : Editor/Data/Resources/PackageManager/ProjectTemplates
These are the templates used by Unity Hub. You can just duplicate one of the folders in there and update the package.json file to have the name and description you want. That will allow you to have a custom template.
It’s obvious that this is not the official way nor something that would survive an update but it’s just to give you an idea of how it works at the moment.
I’m just wondering if it will change because with this solution it means that templates are tied to Unity’s version and that you would need to open Unity then the package manager to update them which is not great in my opinion. Maybe by having the package manager inside Unity Hub would help greatly ?
Yes! I think this will be important for streamlining and improving the Unity user experience! We have a bunch of plans for expanding the template system, including the ability to add and share custom user templates. Keep your eyes open for template updates in future Unity updates!
I hate to revive old threads, but this seems like the only one regarding this specific topic, so I’ll post here and refrain from a new thread to keep things bundled.
Has anyone found a way to add their project as a new template?
Obviously dzamani’s idea seem to be the right direction, and that is what I have been trying before finding this thread, but there seems to be an issue when doing that. At least I am having one:
As soon as the “name” in your newly created template’s manifest is set (or changed, if you have copied one of the other templates) an error occurs when choosing that template for a new Unity project:
“Failed to resolve Project template: the folder or package [XYZ] could not be found”
I tried naming things equivalent to how unity does, so folder and “name” in the manifest are the same, Folders that are copied to the template folder are the same… no difference as far as I can tell except for the manifest name. It really seems to be the name defined in the manifest that is the deciding factor. But it doesn’t recognize the name of my template as an existing folder/template or whatever.
Has anyone sucessfully done this and can tell me if I am missing something?
Any news?
I created a template and would like to understand more about the package.json file. What I want is to open a certain template directly in Android platform. I added this line “buildTarget”:“Android” at the end of the json file and nothing happened. Any hints? or this is not even possible?
Also, is there a way to include folders other than Assets, ProjectSettings and Packages? I would like to include the SteamVR 2.0 generated action json files rather than generating them every time I create a new project.
Thanks a lot guys!
EDIT:
I tried adding the Library folder and it worked like a charm for the “Android part”. Not sure what really solved it, the “buildTarget” or the “Library”. Anyway, I did both in case someone wants to try.
Hey guys.
After I updated to Unity 2018.3.5 today (from 2018.2.16 previously) this seems to actually work if you are willing to go through the following steps (and not wait for unity to enable it though some simple interface of theirs):
Go to your unity installation path and navigate to where the templates are saved. in my cast for example that is:
C:\Unity\Unity2018.3.5\Editor\Data\Resources\PackageManager\ProjectTemplates
From here we want to mimic the way the other tempates are defned. easiest way is to do the following
Copy any of the other template folders and rename the end of it to whatever you want:
E.g.: com.unity.template.mytemplate
Inside that folder, you need to replace the Assets, Packages and Project Settings folders with the ones you want your template to have
Go inside the ProjectSettings folder and delete the text files such as ProjectVersion.txt, so you only have all the .asset files left in it
Go back to your com.unity.template.mytemplate folder and open the package.json file
change the “name” attribute to match your template fodler name, i.e. com.unity.template.mytemplate
change “displayName” to what you want it to say in the dropdown menu when choosing a template for a new project
change the “defautScene” to the path of the scene you want to be opened by default when choosing your template. All relative to the newly added Assets folder, so for example “Assets/Scenes/MyStartingScene.scene”
The rest is optional basically
I tried that out yesterday and was able then to choose my template and it started everything as intended. No more error, like I described a while back in this thread, so they seem to have changed/fixed something with the Engine upgrade. No Idea in which version exactly this started to work, but with the currently newest Version (2018.3.5f1) I was able to do it.
EDIT: it seems that your project version, as defined in the json file, needs to have 3 digits devided by a point, so 1.0.0 for example. That seems to be a convention for the templates, and the Unity launcher will not budge if you do not abide by that. I had 2 numbers at first and I would see my template in the launcher but get errors when trying to open a project using it
instead of copying the assets from a template it would also be nice to provide a custom repository for packages, so i can simply provide a packages configuration for the templates
Just tried this based on @throzen 's post above, but in Hub 2.1.1.
Some things have changed, but baseline is: it is still possible to manually create your own templates.
Unity has packed their templates into tgz files by now. 7zip can open and modify these. I found it easiest to just rename one of the default templates, open it in 7zip and copypaste my correct files in, but you can also just first create a tar archive, then gzip it, and rename the result from tar.gz to tgz.
There’s one thing you must do before copying one of your projects Assets/ProjectSettings/Packages folders in: delete the ProjectSettings.txt, otherwise there’s gonna be an error.