Unity - Scripting API: Handles.Slider

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Returns

Vector3 The new value modified by the user's interaction with the handle. If the user has not moved the handle, it will return the position value passed into the function.

Description

Make a 3D slider that moves along one axis.

This method will draw a 3D-draggable handle on the screen. The handle is constrained to sliding along a direction vector in 3D space.


Slider handle in the Scene View.

Add the following script to your Assets folder as SliderExample.cs and add the SliderExample component to an object in a Scene.

Add the following script to Assets/Editor as SliderExampleEditor.cs and select the object with the SliderExample component.