Skip to content

Spring Debugger

To enable the Spring Debugger, once the Asset Window is open, simply set “Enable Spring Debugger” to true:

The Springs Debugger tab with Enable Spring Debugger ticked, waiting for Play mode

When the Debugger is enabled, springs will be registered and unregistered from the debugger automatically, allowing you to visualize, inspect, and interact with all the springs in the scene from this window. The Debugger has a tiny performance overhead, which is why you can choose to have it enabled or disabled. However, in all cases, it only runs in the Unity Editor. Even if the Debugger is enabled, it will never run or cause any overhead during a final build.

When the game is running and the Debugger is enabled, you’ll see something like this:

The debugger listing five Spring Components in Play mode, one row each with its arrow, GameObject name, component type, State and Ping

In these headers, you can see the name of the object, the Spring Component Type, the State button to toggle the object on and off, and the Ping button to highlight the GameObject in the Hierarchy.

When expanding any item with the left button with the down arrow you’ll see the springs registered in the SpringComponent:

The Chest row expanded into its PositionSpring, ScaleSpring and RotationSpring

In this case, we can see all the position, scale, and rotation springs of the TransformSpringComponent. If we open any of these with the down arrow, we’ll see the same UI that the TransformSpringComponent shows. We can use this to monitor the active springs in the scene and, most importantly, to change their values or quickly iterate on Nudge values. Instead of creating a script and changing the values from there, we can open a spring in the Debugger and try different Nudge values, which we can then bring over to any script.

The PositionSpring opened in Play mode: its Force and Drag settings, then the Playmode Operations panel with the live Current Value, Target and Velocity, an Operation Value, and the Set Current Values, Set Target and Add Velocity buttons

That is the Playmode Operations panel, which every spring shows while the game runs, here and in the component’s own Inspector. It reads out the spring’s Current Value, Target and Velocity live. Type a value into Operation Value and the three buttons apply it: Set Current Values snaps the spring there, Set Target sends it there, and Add Velocity shoves it, the same three moves as the nudges in Nudges and Punches.

Finally, if you press Alt when pressing any arrow button, you’ll affect the whole hierarchy, and all other elements will perform the alternate command of the button you pressed. So if you do Alt+Click to open a spring, all other springs in the list will close.

The Spring Debugger is a powerful tool for visualizing, inspecting, and interacting with the springs in your scene, allowing you to fine-tune and iterate on your spring animations efficiently.