RenderSettings.skybox script edit does not work

I wrote this little script to change the skybox anytime the player interacts with a series of objects, but it does not work, usually the first time I use it works perfectly, the second time it doesn’t change anything anymore. And when I export it the build does not do it.
Here’s the script:

using UnityEngine;
using System.Collections;

public class SkyboxBugger : MonoBehaviour {
	
	public Material Down;
	public Material Sunny;
	public Material Night;
	
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		
				RaycastHit hit;
		Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width/2, Screen.height/2, 0));
		
		
		if(Physics.Raycast(ray, out hit, 2))
		{
			if(hit.collider.tag == "Buya")  
			{
				if( Input.GetButton ("Fire1") ) {
					
				//Change skybox
					RenderSettings.skybox = Down;
				}
			}
			if(hit.collider.tag == "Computer")  
			{
				if( Input.GetButton ("Fire1") ) {
					
				//Change skybox
					RenderSettings.skybox = Sunny;
				}
			}
			if(hit.collider.tag == "JoyStation")  
			{
				if( Input.GetButton ("Fire1") ) {
					
				//Change skybox
					RenderSettings.skybox = Night;
				}
			}
			
		}
	
	}
}

Check if the materials are assigned and check the console for any logs. Also, here is a documentation on RenderSettings.skybox:

The way you assigned the skybox looks right so it is probably another problem.