I am building my own local package that I want to contain a Game Object and a script added to it. The purpose is to have a game object in the package that has a specific behavior dictated by the script.
I fail to do that even with the simplest form (using empty scripts). Any idea? All the doc and tutorials I find about packages are trivial packages that all contain only a script, or only sprites, but not game objects with attached scripts.
-
I created a package that contains a script with just the declaration of the class. When I create a empty Game Object in the scene of a test project and try to add to it the script from the package, it fails (“Can’t add script component ‘Windmap’ because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match.”). See the attached screenshot. The object name, class name and script name match (all ‘Windmap’).
-
I also tried create a prefab of the object in the package, create a script in the package, and add the script from the package to the prefab from the package: it also fails wih errors “The referenced script on this Behaviour is missing!” and “The referenced script on this Behaviour (Game Object) is missing!”, see second screenshot.
See screenshot 1:
See screenshot 2: