When Value is Changed
Fires whenever the progress bar's value changes, whether a script or the player caused it.
Introduction
When Value is Changed is an event in the Progress Bar group of UI Events. It fires whenever the progress bar's value changes, whether a script or the player caused it. Like every event, it does nothing by itself. It waits for the right moment, then runs all the actions connected to it. Progress bars visualize values that move: this event fires whenever the bar's value changes, whether it is a loading screen, a boss health bar, or a race progress track. The element and its fill styles are described in the UI Progress Bar guide, and for player-controlled values compare with When Slider is Changed . When Value is Changed event in the UI Editor Image The When Value is Changed event in the UI Editor. caption When Progress Bar is Changed, fires when the value shown by a UI progress bar changes. This event is attached to: the Progress Bar widget inside a UI panel. It belongs to the "Progress Bar" group because its home is a UI widget, not a 3D object in the game world.
Parameters
None This event has no parameters. The event fires on its own and everything you need is the object running this script. Parameter Description
How to Access
How to Access - When Value is Changed
How to Use
Select the progress bar element and open its properties, then find its component block. Check that the When Value is Changed event is listed in the block; if it is hidden, press the three dots (...) at the top right of the block and check it in the pop-up list. Press Scripts + next to When Value is Changed , then add the actions that should run when the event fires: how to react to the new progress value, such as updating a label. Read the bar’s current value in the connected actions to show the right number. Press Play and change the bar’s value to confirm the actions follow it.
Example
When Value is Changed event with an update text command when-progress-bar-is-changed-example.webp Example: the progress bar follows the player's health value in real time. caption
Common Uses
Loading and download readouts Quest or objective progress displays Syncing other UI with the bar's value
Tip
Progress bars usually change from scripts, not the player. Make sure the script that fills the bar is the one driving this event.