Add a slider
Add a slider to your Snitch panel. You drag it in the overlay or the web dashboard, or write it with snitch slider.
This page uses the Snitch API (Snitch.Api). For the Hotline API, see the Hotline slider guide.
You need: a Snitch panel. See Profile your mod.
-
Call
Slideron your panel, insideSnitchProbe.Register().using Snitch.Api;Panel p = Profiler.RegisterPanel("Yoink", "Yoink (Winch)");p.Slider("size", 0.2, 2.0, () => WinchItem.HeldScale, v => WinchItem.HeldScale = (float)v, 0.05, "x");p.Slider("pull force", 0, 60000, () => Preferences.PullNewtons, v => Preferences.PullNewtons = (float)v, 500, "N"); -
Pick a range wider than the values you expect. The ends are hard limits.
-
Give every slider in the panel a label that differs in its words. See “Label collisions” below.
The signature:
Panel Slider(string label, double min, double max, Func<double> get, Action<double> set, double step = 0d, string unit = null)| Parameter | Meaning |
|---|---|
label | Text next to the value. It also makes the slider id. |
min / max | Ends of the track. max must be greater than min. |
get | Reads the current value on the main thread. |
set | Applies a new value on the main thread. |
step | Snap increment. 0 means continuous. |
unit | Short suffix after the number, for example m, N, deg. Optional. |
The static form is Profiler.RegisterSlider(panelId, label, min, max, get, set, step, unit).
Snitch clamps the value to [min, max] and snaps it to step before it calls set. Your setter needs no range check.
Check it works
Section titled “Check it works”- Run
snitch panels. The panel lists one more slider. - Run
snitch slider Yoink:size. It prints the value, range and step. - Run
snitch slider Yoink:size 0.85. The game applies the clamped, snapped value. - Drag the slider in the overlay or the dashboard. Both use the same path.

Label collisions
Section titled “Label collisions”A slider id is <panelId>:<slug of the label>. The slug keeps letters and digits, lowercases them and turns every other run of characters into one hyphen.
| Label | Id in panel Yoink |
|---|---|
size | Yoink:size |
pull force | Yoink:pull-force |
size -0.05 and size +0.05 | both Yoink:size-0-05 |
Two labels with the same id replace each other. No warning or log line appears, and the first control disappears. Use size down and size up, not size -0.05 and size +0.05.
- Register from the Unity main thread.
- A call is dropped silently if
maxis not greater thanmin, or ifgetorsetis null. - Registering the same id again replaces the slider. Running your probe twice is safe.
- Overlay, dashboard, phone remote and console all reach the same
set. Write it so any of them can call it at any time. - On a Snitch without sliders, the call is a no-op.