If you're using HDRP in this project

Hey. I started this unity project using High Definition Render Pipeline and at this step (when you are changing color of start and end waypoints) Ben’s solution won’t work.
To get this working you need:

  1. Find “Top” object just like in the lecture.
  2. Find shader of a material.
  3. Set color of the material using ("_BaseColor", color).

It should look like this:

public void SetTopColor(Color color)
    {
        MeshRenderer topMeshRenderer = transform.Find("Top").GetComponent<MeshRenderer>();
        topMeshRenderer.material.shader = Shader.Find("HDRP/Lit");
        topMeshRenderer.material.SetColor("_BaseColor", color);
       
    }

Privacy & Terms