Effects and animations
Your Widget Blueprint shows hover, click and states itself, from the fields the kit writes.
The kit handles interaction only: aiming, clicks, states and events. It draws nothing on your widget. For every state players should see, the layout writes a Verse field of your WBP, and your WBP shows the state with its own look: an animation, a glow, a lock, a fill bar.
Each element has five states: hover, click, on or selected, the value of a slider, and disabled. In the online editor, you choose for each state of each element how your WBP shows it.
| Choice | What happens |
|---|---|
| Show a widget (default) | A float field, bound to the Render Opacity of a widget of your WBP (a highlight, a glow, a lock…). |
| Animation in my WBP | The same float field starts an animation of your WBP, through two View Binding conditions. |
| Nothing | No field: the WBP does not show that state. |
By default, every element gets a hover and a click field, and toggles, choices, tabs and sliders a field for their state. Disabled is off by default: turn it on for elements you disable.
Without fields, nothing lights up
A widget without fields still works: clicks, events and the Verse API are all there, and the crosshair dot grows
over the elements. But players see no hover and no state. This is the case of a widget described only with the
Elements list of the Details panel.
The fields
The name of a field is the element name followed by the state.
| State | Field | Type | Value |
|---|---|---|---|
| Hover | <Name>Hover | float | 1.0 while a player aims at the element (shared states: at least one player), else 0.0. |
| Click | <Name>Pressed | float | 1.0 for 0.12 s on each click. |
| On or selected | <Name>On | float | 1.0 while a toggle is On, or a choice or tab is selected. |
| Value | <Name>Value | float | The position of a slider, from 0.0 to 1.0. |
| Fill | <Name>Fill | float | The same position in widget units: <Name>Value × the length of the slider. |
| Value as text | <Name>Text | message | The value of a slider as players read it (75, 0.25). Optional. |
| Disabled | <Name>Disabled | float | 1.0 while the element is disabled. |
| Screen | Screen | int | The active screen, for a WidgetSwitcher. One per widget. |
Why float fields
Verse cannot start a widget animation. In UEFN, the only way is a View Binding condition, and a condition only
reads int and float fields. A float field set to 0 or 1 works with a condition, and binds directly to
Render Opacity, with no conversion.
No event fields
A WBP placed in the world must not have Verse event fields: UEFN then skips its entity class and the layout cannot
write its fields. Clicks come from the kit: ClickedEvent (with the player), SubscribeClicked, or the logic file.
Show a widget
Example: the element Buy, with a highlight on hover.
- In the WBP, put an image over the button: the highlight, with the same shape as the button.
- Add a variable
BuyHover, of type float, and tick its Verse box. - In Window > View Bindings, bind the Render Opacity of the highlight to
BuyHover.
The highlight is visible (opacity 1) while a player aims at the button, and invisible (opacity 0) otherwise. The same
pattern works for a selection (<Name>On), a press flash (<Name>Pressed) or a lock (<Name>Disabled).
Play an animation
Example: the element Buy, whose hover is an animation.
Create the field
In the WBP, add a variable named BuyHover, of type float, and tick its Verse box. Compile the WBP, then build
the Verse code, so that the generated layout finds the field.
Create the animation
In the Animations panel, add an animation named BuyHoverAnim (the editor suggests <Name><State>Anim), and
animate the hover: a scale, a glow, a colour.
Add the conditions
Open Window > View Bindings and click + Add Condition twice:
| Field | Operator | Value | Action |
|---|---|---|---|
BuyHover | == | 1 | Queue Play Animation, In Animation BuyHoverAnim |
BuyHover | == | 0 | Queue Play Animation, In Animation BuyHoverAnim, Play Mode Reverse |
For a click animation, add only the first condition (== 1): the field goes back to 0 by itself.
A condition runs when its field changes value: the animation plays when the player starts aiming at the button, and plays in reverse when they look away.
Sliders
A slider gets two floats:
<Name>Fill, its position in widget units. Bind it to the Width Override of a SizeBox (the Height Override for a vertical slider): the SizeBox holds the fill bar, which grows from the left. To move a knob, put a SizeBox bound to<Name>Fillbefore it, in a horizontal StackBox: it pushes the knob along the track.<Name>Value, from 0 to 1, for your own bindings.
Tick Text field in the editor to also write <Name>Text, the value as a text, and bind it to the Text of a text
block.
In the generated layout
The layout writes each field when the state changes. A comment says what the field is for, and the editor reads it back when you open the file again.
SetHovered<override>(Widget:entity, Element:string, On:logic):void =
if (W := Shop.WBP_Shop_entity[Widget]):
Value := if (On?) then 1.0 else 0.0
case (Element):
"Buy" => set W.BuyHover = Value # Render Opacity of the widget to show
"Gold" => set W.GoldHover = Value # plays GoldHoverAnim
_ => {}
SetPressed<override>(Widget:entity, Element:string, On:logic):void =
if (W := Shop.WBP_Shop_entity[Widget]):
Value := if (On?) then 1.0 else 0.0
case (Element):
"Buy" => set W.BuyPressed = Value # plays BuyPressedAnim
_ => {}
SetValue<override>(Widget:entity, Element:string, Value:float, Fraction:float, Text:string):void =
if (W := Shop.WBP_Shop_entity[Widget]):
case (Element):
"Volume" =>
set W.VolumeValue = Fraction # 0..1 along the slider
set W.VolumeFill = Fraction * 488.0 # Width Override of the fill (a SizeBox)
set W.VolumeText = InteractiveText(Text)
_ => {}
SetEnabled<override>(Widget:entity, Element:string, On:logic):void =
if (W := Shop.WBP_Shop_entity[Widget]):
Value := if (On?) then 0.0 else 1.0
case (Element):
"Gold" => set W.GoldDisabled = Value # Render Opacity of the widget to show
_ => {}To write fields, the layout needs the path of your WBP: the editor reads it from the pasted hierarchy, or from the
Widget Blueprint box. A WBP inside a folder named UI cannot be used this way, because that name clashes with
the UEFN UI module: move it to another folder.
Per player
With States set to PerPlayer, each player has their own states, but the fields of the WBP belong to the widget,
which everyone sees. Keep Per-player copies on in the editor (on by default): each player then gets their own copy
of the widget, and its fields show their own states. See Shared and per-player states.
Colours in the world
Widgets in the world are lit in linear space: a colour or an opacity looks stronger in the Designer than in game. Check your effects in a session.