I tried everything online the class name is the same as the file name but I keep getting this error, and also the console is also giving me nothing.
Unity version: 2019.2.12f1
this error appeared when trying to add script to object :
I tried everything online the class name is the same as the file name but I keep getting this error, and also the console is also giving me nothing.
Unity version: 2019.2.12f1
this error appeared when trying to add script to object :
OK, what this probably means is that the filename and class name are different - this happens when you rename files outside unity and always recommend you rename within Unity and keep the class name and file name in sync.
Check that the class name, Player, matches the file name and also refresh the folder within unity:
public class Player : MonoBehaviour {
UPDATE
Not to overstate the obvious, also confirm you have no compilations errors in your console. Access the console via window -> console