# Changing Light Intensity value

I have this code for creating a light:

            GameObject lightGameObject = new GameObject ("Light1");
lightGameObject.light.color = Color.white;

lightGameObject.light.intensity = 0.5f;


I want to change the light's intensity to 0.5f but when I run the game, the intensity's still at 1.