rendersettings.skybox not working? c#

Ok so its a bit strange that render settings is not working, the main reason being is I have the exact same script in my other game and it works fine, its a simple script. basically what happens is if I write the script the skybox will just give the default blue, I have been at this for hours, I’ve read everything online and can not find out what’s going on. the materials have been set in the inspector and everything checked and double checked.

I will write the script how I wrote it in Unity.
public Material dayMat;
public Material nightMat

void Update ()
{
if (Clock.hours >= 5 || Clock.hours <= 21) {
RenderSettings.skybox = dayMat;
} else {
RenderSettings.skybox = nightMat;

	}

}

all this does is return the default blue sky and very strange I have the same script in my other game?

does anyone have the same problem or know anything ? thanks in advance.

public Material mat;
public Material day;
public Material skyBox;

5.
 float t = 0.02f;
 float a;
 // Use this for initialization
 void Start ()
10. {
        RenderSettings.skybox.Lerp(skyBox, mat, 0.5f);  //Here assaying mat matiral as default .
 }
 
 // Update is called once per frame
15. void Update ()
 {
         a = (Time.time *4) % 360;

         transform.eulerAngles = new Vector3(transform.rotation.x + a , transform.rotation.y, transform.rotation.z);
20.
       
         if(a > 25 && a < 150 )
         {
            //Changing default to day matiral skybox.
25.             RenderSettings.skybox.Lerp(skyBox,day,0.5f * Time.deltaTime); 
         }
          
        else if (a > 150 && a < 185)
         {
30.             //Changing day matiral to mat matiral
             RenderSettings.skybox.Lerp(skyBox,mat,0.5f*Time.deltaTime);
         }
 }

You can try this for changing skybox.