Slider.value error

I’m trying to access the value of a slider in the scene but every time I write .value for the variable set as a slider an error comes up saying ‘Slider’ does not contain a definition for ‘value’ and no extension ‘value’. Also using UnityEngine.Ui doesn’t light up in the script so it seems it’s not accessing the library when I try to create a variable for a Slider. Is VisualStudio and/or Unity bugging out or am I making a mistake in my code?

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

public class PlayerHealth : MonoBehaviour {

    public float playerHealth;

    private Slider slide;

    private void Start()
    {
        slide = GetComponent<Slider>();
    }

    private void Update()
    {
        slide.value = playerHealth;
    }

Do you happen to have another class called Slider in your project and it is using that instead of the one in the UI namespace?

In VS, you can place your cursor over Slider and press F12 to navigate to the class.

I see that you are using the UnityEngine.UI namespace though and the Slider class in that does have a public variable value.