I have a lot of objects that have no renderer attached and I need to set the object’s colours at run-time.
object.renderer = new Renderer(); doesnt seem to work…
this is the error i get → Assets/ColouringScript.cs(15,32): error CS0200: Property or indexer `UnityEngine.GameObject.renderer’ cannot be assigned to (it is read only)
FYI, the updated way to add a renderer is now gameObject.AddComponent().
The IDE told me the (“T”) version was deprecated.
Thank you, @Seth-Bergman for leading me to the door of the answer!