If a script has the same name as a built in component, the following warning is displayed in the Unity console:
Script 'Grid' has the same name as built-in Unity component.
AddComponent and GetComponent will not work with this script.
Presumably, this means GameObject.AddComponent(string) and GameObject.GetComponent(string), both of which are marked as obsolete, and should be replaced with typesafe versions, using typeof or type parameters.
However, the warning remains. Add an inspection to mimic this warning inside the code editor.
Also, add a code inspection wiki entry to provide more details. Will probably need more information on the list of known components and why it doesn't work with AddComponent/GetComponent.
It is because you are using for the script's name a name that unity uses for one of their internal component or Object.
Eg: "Camera" you cannot have other thing with this name
If a script has the same name as a built in component, the following warning is displayed in the Unity console:
Presumably, this means
GameObject.AddComponent(string)
andGameObject.GetComponent(string)
, both of which are marked as obsolete, and should be replaced with typesafe versions, usingtypeof
or type parameters.However, the warning remains. Add an inspection to mimic this warning inside the code editor.
Also, add a code inspection wiki entry to provide more details. Will probably need more information on the list of known components and why it doesn't work with
AddComponent
/GetComponent
.