Script generation not working

Hi :smiley: When I create a Minimal Needle scene (Unity 2021.3.9, Exporter 2.28.0-pre, Runtime 2.24.0-pre) and follow the instructions on Github, the script generation is not triggered. Unfortunately there is not Needle folder at all in the project view. Is there smth I may have missed? br, Max

Original Post on Discord

by user 474974683163394049

Hey Max, are you creating your script in src/scripts ? Could you try saving your script again and then focusing Unity? If that doesnt help try enabling/disabling the ComponentGenerator component

The Needle folder is only created by component gen if you write your scripts in src/scripts. If you create an npmdef the generated components land where your npmdef is

I tried everything you mentioned. The script creation itself started working after I added a npm def file manually. :thinking:

by user 474974683163394049

Deleted the npm def file and still works, so maybe it was just a hiccup Oo

by user 474974683163394049

They are not related tho - the npmdef does bring its own typescript watcher with it. I guess something else fixed it (maybe the import?) - but glad it works now

That being said I would recommend using npmdef’s if you want your code to be re-useable in multiple projects

Should the file delete also be synced? Because creation works, but after I delete files, the C# stubs will still remain in my Unity project.

by user 474974683163394049

Scripts generated via scr/scripts are not deleted. They are in npmdef because with those we can guarantee that a component is always created from one typescript source

I have same problem, my script are not automatically generated.
But the generator has been used I can see many logs in console when I save .ts file

by user 191204280198234122