This may be a noob question, maybe I’m missing something basic, but as I try to create a package (my favorite little utility scripts), those scripts are unusable. Trying to drop a behavior from my package onto a game object gives me: "Cant Add Script: Can’t add script component ‘HandyThing’ because the script class cannot be found. Make sure blah blah blah "
Well, I cut my sample down to one script. No naming errors. No errors or warnings in the console. If I drag the script under Assets, it works fine, but of course breaks my package (no?).
I thought maybe this was some sort of protection thing, but I dumped a texture into my package, and I was able to use that on a Material no problem.
What am I missing? Do I have to have an asmdef file?
Sorry you are experiencing this issue! Which version of Unity are you using?
Yes, Assembly Definitions are required for packages, your scripts won’t work otherwise.
@AskCarol Would be great if Unity could add a warning for (local) packages that contain scripts but no Assembly Definition.
Thanks for the feedback. Definitely something I’ll pass on to the scripting team to improve your experience.
I wandered around for a whole week before realizing it was the assembly definition that was missing. An accurate error message would definitely be helpful. Still happens in 2019.4.17f1 and 2020.0.1f1
Are you able to provide a screenshot of this with the version number intact? Our team’s having trouble reproducing this on their end.
Still not present in manual
From talking with the team, they do feel that it is mentioned in the documentation several times. Also, the warning system is already in place. Are there strong feelings that it should be amended in someway to be clearer, or provide more context?
Years later I stumbled upon the same problem. This is not clear at all in the documentation unfortunately. Using 2021.3.9f.