I have checked my code over and referenced the code found in the Gitab files. I still can not figure out why I am getting the following error.
“MissingComponentException: There is no ‘MeshRenderer’ attached to the “Unit” game object, but a script is trying to access it.
You probably need to add a MeshRenderer to the game object “Unit”. Or your script needs to check if the component is attached before using it.”
In test, Unit does show the icon underneath them when clicked, however Unit(1) does not.
I get the error for both units however. Unit and Unit(1)
The error tells you all you need to know: You don’t have a mesh renderer attached to the game object. Can you show the objects in the hierarchy and their respective inspectors?
There it is. UnitSelectedVisual is trying to get a renderer from this game object, but there isn’t one. This component should only be on the SelectedVisual game object - which you have