void Update () {
slider.wholeNumbers = true;
}
public void Test(){
WeaponsIndex = slider.value;
}
This is where my problem is residing in my code. I’m getting a
Cannot implicitly convert type float' to int’. An explicit conversion exists (are you missing a cast?)
No matter what I do. I figured changes in the code in update that whole numbers would be true would solve it however slider.value is still a float instead of int.
It is an int, however even the code you provided still gives the same error
– PixelithInstead of casting float, casting int worked out. so
– Pixelith(int)slider.valueYes, sorry! That's what I was trying to say, you cast the float value of the slider as an int to copy it into an int variable. Was writing some other stuff and got distracted here. Glad it worked somehow.
– DiegoSLTSI still marked your answer right, because you saved me a major headache and helped me learn something I've never seen before
– Pixelith