Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

C# How to Use the Scrollwheel to Scroll Through an Array

$
0
0
Hi everyone, I have been trying to create a script where you can use the scrollwheel to scroll through an array. But for some reason I get this error cannot convert type bool to type float.Any idea how to fix this? public string[] someStrings; public string currentSomeString; void Start(){ someStrings = new string[]{"text1","text2","text3"}; } void Update () { for (int a = 0; a < someStrings.Length; a++){ if(Input.GetAxis("Mouse ScrollWheel")){ currentSomeString = someStrings[a]; } } }

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>