using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WhiteSheep : MonoBehaviour {
public Color altColor = Color.white;
//I want to change the colour from white to red
public Renderer rend;
void Start ()
{
rend = GetComponent<Renderer>();
//so we can access the colour
rend.material.color = altColor;
//this is to set the initial color 0f
altColor.b += 0.1f;
//it alters the color
rend.material.color = altColor;
//this is to assign the changed color
}
}
I want to make a sheep change its colour, but when I play it, I can see the colour change on the ride hand side in unity, but the colour of the sheep doesn’t change. Can you please help me?