Hello,
I have an existing asset package that was created via exporting from a project (.unitypackage) as described on the unity docs page here. I am trying to “convert” this package to a custom package that can be imported by package manager per the very first line on that page which recommends doing so via the custom package process described here. I am using Unity 2020.3.30f1. The package contains some dependent library files, a few scripts, a sample prefab and a sample scene
As a .unitypackage, the package imports its contents to Assets/ and the sample scene, prefab and scripts are all useable with no issue. When importing via the UPM (selecting the package.json file) all the package contents are added to Packages/. All the expected files are present and no errors appear in the console after the import.
The issue arises when I try to use any of the package contents in the project itself. When attempting to attach a script from the package to a scene object (even when copying the script to Assets/ first) I receive a “script class cannot be found. Make sure there are no compile errors and that the file name and class name match” error despite there being no compile errors and the names indeed match.
Could anyone help me understand why the package contents are unusable in this way and what I might need to do to achieve a similar result as when importing using .unitypackage? Is there even a point to trying to make a custom package as Unity recommends here or am I just wasting my time?