UI Slider
Adds a bar you drag to set a value, for example how strong an effect is. The bar is horizontal, and you choose its size and colors.
Game engines, physics, quizzes, leaderboards, and the UI controls that tie it together.
Made with this blockInputs
heightfloatThickness of the slider bar in screen units. Recommended range 0.02–0.1. 0.05 is a clean thin bar; 0.06–0.15 is chunky/bold. Keep below 0.1 so it still reads as a slider, not a button.
widthfloatLength of the slider in screen space units. Recommended range (0.6–1.8). 1.8 = full screen width; 1.4–1.6 for inset sliders; smaller for compact controls.
positionvec2Screen-space position of the slider's center (0.0 to 1.0). - Center: [0.5, 0.5] - Near bottom (typical): [0.5, 0.85] - Near top: [0.5, 0.15]
thumbSizefloatMultiplier on the thumb's base size. Range 1.0–5.0. 1.0 = compact, 2.0 = comfortable touch target (mobile default), 2.5+ = chunky/playful.
barColorvec4Color of the inactive track (not yet filled). Each channel 0–1. Use a low-saturation neutral so the active fill and thumb pop. Translucent alpha (w < 1) for subtle/secondary looks.
trackBarColorvec4Color of the active fill — the portion between the start/center and the thumb. Each channel 0–1. It is usually an accent color. Ignored when trackBarMode = 0.
thumbColorvec4Color of the draggable thumb. Each channel 0–1. Must contrast with barColor. Often matches trackBarColor for a unified accent, or contrasts for emphasis.
trackBarModeintFill style of the active track. 0 = None (no fill, only the thumb moves — minimal/static). 1 = Start / "Progress" (fills from left edge to thumb — standard progress affordance, recommended default). 2 = Center / "Balanced" (fills outward from midpoint — for bipolar values like +/- intensity).
rotationfloatSlider's rotation
Functions
getValuefloatReturns slider's value.
setValuefloatSet slider's value.
More in Games & Interactivity
- JoystickAdds an on-screen joystick that you drag to move or steer something in the Lens. Choose where it sits, how big it is, and how it looks.
- LeaderboardSaves the scores from your Lens and shows them in a ranked list. You can compare with friends and with people around the world.
- Physics2DMakes 2D objects fall, collide and bounce off each other like real things. It draws nothing itself, so the Lens needs something else to show the objects.
- QuizRuns a quiz on the screen, with buttons or a tilt of your head to answer. Say what the quiz is about, for example American history or your personality type.
- Tic Tac ToeAdds tic tac toe on a 3D board, for one player against the Lens. Choose the look of the board and the two 3D pieces.
- Turn ManagerRuns a two player game that you send to a friend. You take a turn, then your friend opens the Lens and takes the next one.
- UI ButtonAdds a button you tap on screen. You choose the label, the color, the shape, pill or circle, and where it sits on the screen.
- UI Progress BarShows a bar that fills up to track progress, for a countdown, a timer or a level. You choose the size, the colors and up to three checkpoint marks.
- Video Control UIPlays your videos full screen, one after another, with play, pause and a bar you can drag. You add up to five videos.
- What X Are You?Spins through options above your head and stops on one, for example a star sign or a persona. You give up to six options, as text, pictures or both.
