I've been trying to change the Colour of the cube when it's triggered, basically when the cube is on top of the plane (Checkpoint). I've applied Standard Material to the plane, changed the Albedo property to blue colour and nothing seems to be happening. I know it's very simple but seems like I'm missing something here? Any help would be appreciated.
public class Checkpoint : MonoBehaviour
{
Renderer colorRenderer;
public void Start()
{
colorRenderer = GetComponent<Renderer>();
}
public void OnTriggerEnter(Collider collider)
{
if(collider.gameObject.tag == "Player")
{
colorRenderer.material.SetColor("_Color", Color.green);
Debug.Log("Checkpoint Reached");
}
}
}