- Home /
Controlling an objects axis with UI Slider
I'm new in Unity and trying to learn some basics. I have a default UI slider with a spesific range (0.6 - 1.4), and want to control a gauge needle in Z axis with it. If I set the slider max value (1.4) I need that needle rotate to a spesific max angle, and vice versa with the lowest slider value. (or in between angles for other values).. Thank you!
Answer by game4444 · Aug 07, 2017 at 01:10 PM
Make Public GameObject Needle;
Drag your needle in this GameObject. You have to do some maths which will give you how much u will rotate needle. Then Needle.Rotate(0,0,ValueTakenFromSLider); hope it will give you some idea.
Your answer
Follow this Question
Related Questions
How to make camera position relative to a specific target. 1 Answer
Rotate Object on single Axis (Slider UI) 0 Answers
How to get all gameObjects with a script on them 1 Answer
Material for Image UI component does not work in WEBGL 2 Answers
Why the control with gyroscope inverted when I make 180 degrees turn? 1 Answer