How to change text based on the value of a scrollbar?
I'm making a character creation screen with stats and I want a scrollbar to change the displayed text (the higher the value, the higher the stat). I'm using only standard UI elements provided by unity, so I'm using GameObjects Text and Scrollbar. I know it's the "value" variable in scrollbar I'm after, but I don't know how to access it. I've made a script in the Text game object but I have no clue of how to go from there.
Answer by Chrizie · Dec 03, 2015 at 01:14 PM
For the few who care I figured it out. I made the custom script to use the GetComponent and GetComponentInChildren functions, and I made the text a child of the scrollbars. Then I used the toString method to convert the integer to string so it could be put into the text.text
Your answer
Follow this Question
Related Questions
Double vs Float 1 Answer
What Am I doing Wrong Here 1 Answer
Application.LoadLevel is not destroying anything 1 Answer
Scroll View Children not Behaving (UI Instantiated Prefabs not conforming to guide) 0 Answers
Weapon arsenal Inventory UI 0 Answers