In old versions of Unity Component's renderer had material, now UnityEngine.Renderer has material, but Component.renderer doesn't have. How can I change the color of my object?
private Transform myTransform;
...
private void changeColor()
{
myTransform.renderer.**material**.color = Color.red;
// renderer doesn't have *material*
}
By this thread, try