Hello i have a slider in my scene and i want it to change a float value from 1 to 3. But i dont know how to do this. If you can tell me how please do so, and use pictures! Thanks.
here is my code if needed:
var Crosshair1 : GameObject;
var Crosshair2 : GameObject;
var Crosshair3 : GameObject;
var SliderValue : float;
function Update ()
{
//crosshairs
if(SliderValue == 1)
{
Crosshair1.SetActive(true);
Crosshair2.SetActive(false);
Crosshair3.SetActive(false);
}
if(SliderValue == 2)
{
Crosshair1.SetActive(false);
Crosshair2.SetActive(true);
Crosshair3.SetActive(false);
}
if(SliderValue == 3)
{
Crosshair1.SetActive(false);
Crosshair2.SetActive(true);
Crosshair3.SetActive(false);
}
}
//crosshairs
function ChangeToCrosshair1 ()
{
SliderValue = 1;
}
function ChangeToCrosshair2 ()
{
SliderValue = 2;
}
function ChangeToCrosshair3 ()
{
SliderValue = 3;
}
