Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Make slider disappear when reach max value

Discussion in '2D' started by loafy123, Apr 16, 2020.

  1. loafy123

    loafy123

    Joined:
    Feb 19, 2020
    Posts:
    8
    Hello, I am new to Unity. I want to make the slider disappear when the max value is reached. How do I do it?
    I done a script but it is not doing anything. (The max value for the slider is set 5)

    public Slider patientslider;
    public float value;
    public bool IsON;


    void Start()
    {
    IsON = true;
    patientslider.enabled = true;
    }
    public void Changes()
    {
    if( value == 5)
    {
    IsON = false;
    patientslider.enabled = false;
    }
    }
     
  2. loafy123

    loafy123

    Joined:
    Feb 19, 2020
    Posts:
    8
    Ok, found my problem.