// Update is called once per frame void Update() { slider.value = energyScript.GetEenergyAmount(); }
// Start is called before the first frame update void Start() { energyScript = energyObject.GetComponent <MoveablePawnScript>(); slider = GetComponent <Slider>(); slider.value = energyScript.GetEenergyAmount(); }