Brightness slider ?

I added slider to control the brightness in my game. It give me no error but i cant move it. I changed the Lightness from skybox to color. here is my code:

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class lightness : MonoBehaviour {

    public Slider Brightness;
    float bri;

    // Use this for initialization
    void Start () {
       volumeSlider.value = 0.5f;

    }

    // Update is called once per frame
    void Update () {
        Brightness.value  = bri;
        RenderSettings.ambientLight = new Color (bri,bri,bri,1);
    }
   
}

How to fix this ?

You are assigning slider value to be “bri” value, so flip them

bri = Brightness.value ;
1 Like

OK. now the slider is moving but i can’t see any bright in my game screen ?

Theres also RenderSettings.ambientIntensity = …;

What kind of materials/objects you have on the scene? Does it work if you adjust from Lighting tab manually?

1 Like

Sorry. you right, the bright of the environment is changing. What i ask for is the full screen even canvas.