Where to put template projects? Assets folder has errors

So I made a new template and was wondering should the entire project for that template be contained within the Assets folder?

I have my projects in a projects folder that is in the same folder as my Assets/Project Settings/Library etc so it isn’t inside Assets.

Following the guide:

  1. I did the right click > Create/Needle Engine/Project Template to make a template
  2. I then copied one of the basically empty projects from my ‘projects’ folder to Assets/Templates
  3. I then moved that Project Template asset into that folder
  4. Now unity gives me a tonne of errors that type Type 'MyComponent' already defines a member called 'myMethod' with the same parameter types which is probably because the project is in Assets folder.

What am I doing wrong here? The guidance in the docs is a bit vague

Original Post on Discord

by user 103054507105067008

First of all dont ever copy a “node_modules” folder inside Unity :slightly_smiling_face: you’ll never ever need that.
Could you show the full error? If you get compiler errors its most likely not related to the template structure or creating a template but some other error in your project

Errors went away when I deleted the node_modules folder from the project I copied

by user 103054507105067008

Seems like “MyComponent.cs” exists in multiple folders now?


Maybe because of a symdir within node_modules

I wasn’t sure as I thought I saw some samples or example project where the actual ‘project’ was inside the assets folder a long time ago so wasn’t sure

by user 103054507105067008

node_modules are generated when you install the npm package. You never want that in Unity directly and it easily crashes Unity depending on your project size / dependency count since npm packages can pull in a lot of files

Not sure what you mean - that was never the case for templates at least ^^

I think I’ve got the template working now

by user 103054507105067008

same with projects with node_modules - if that ever happened it would be a big big issue :slightly_smiling_face:

Great! Basically they’re just a marker for copying a folder recursively

thats why last time putting it inside assets was a problem :wink:

I added some checks since then to make sure huge copies like that dont happen anymore :smile:

or at least warn

All sorted, dw if I ask silly questions like these it’s because I searched up what I was doing first here due to the getting started guide on it I linked being a bit vague due to being under construction. Thought I’d document what I first did, what the errors were and what I did to get it all setup and working as a template :+1:

by user 103054507105067008

Yes :slightly_smiling_face: that’s good :slightly_smiling_face:

I think for some of the people at my work I want to have using Needle hopefully early next year, they are not as technical as me so they would definitely do something like copy an existing project with node_modules folder into Assets to be a template as they wouldn’t know that is wrong to do

by user 103054507105067008

Would be super cool to have some way to generate a template from an existing project similar to the export scene as zip option one day to avoid that :sunglasses:

by user 103054507105067008