,I can't find my .cs file in "Add Component"
I create a .cs file in unity, write the codes, save it, but I cannot find my file in the "Add Component" section. Also, in line 5 it says "NewBehaviurScript", not the file name, next to "public class". Also, Rigidbody2D is absent.
program I use: Visual Studio 2019 | Unity | 2019.4.10f1 lts
https://colab.research.google.com/drive/1pf8Fv-satYYU5IudWY09gq8IqYS39tsH?usp=sharing,I create a
Answer by streeetwalker · Sep 16, 2020 at 09:39 PM
You must ensure the filename matches the class name exactly, upper and lower case. If they do not, sometimes the entire system goes wonky. Sometimes wonky enough that the only way out is to 1. copy your code to a safe place outside unity. 2. Delete the file, 3. quit and restart your project, 4. create the script again, 5. paste in your code and correct the class name so it matches the file name.