I have a variable in javascript, let’s say “health”, that I would like to display it on a slider. How do I do that? I tried every way possible but it just doesn’t work. Also, there’s not any documentation available for javascript, I could only find for C# and I don’t understand it.
I attached this script to my UI Root, but I’m getting error.
var sliderShowHealth : GameObject;
sliderShowHealth = GameObject.Find("healthBar");
function Update () {
sliderShowHealth.GetComponent(UISlider.Value) = //insert health variable here
}