It gives me an option to add the script, which I do, but I’m not sure it is the right way to do it? Is it another case of Unity versions again?
The ideal place to add a script is within the assets folder, usually under the scripts folder… Right Click and select New C# Script, and name the script with what you want the name of the class should be.
If you haven’t created a Health Script already, then when you try to add a component to a GameObject called Health, it will ask you if you want to create the script. This is fine, but it does mean the script may not necessarily be placed in the assets folder where you want it. You can move the script to organize your scripts at any time, but under no circumstances should you rename the scripts (unless you also change the name of the class to match).
This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.