set_widget_navigation
Author a widget's gamepad and keyboard focus rules so menus respond to D-pad, Tab and Shift+Tab, setting Wrap, Stop, Escape or Explicit targets per direction.
Instructions
Author a widget's GAMEPAD/KEYBOARD navigation rules -- what gets focus when the player pushes up, down, left, right, Tab or Shift+Tab off this widget. Without this a menu cannot be driven with a pad, and it is NOT reachable through set_widget_property: UWidget::Navigation is an Instanced SUBOBJECT that starts null, so there is no asset path a reflection setter could point at and a dotted path fails on a null segment. Follows the editor's own flow, including the two details that matter: the subobject is created RF_Transactional with template flags propagated, and if all six directions end up on Escape the subobject is DISCARDED (that is what tells "no navigation authored" apart from "navigation authored that happens to be the default", and it is what the Designer does). Read the result back with get_widget_blueprint_tree include_navigation=true.
Returns: { widget_bp_path, widget_name, applied: [{direction, rule, widget_to_focus}], current_navigation: {Up:{rule,widget_to_focus}, ...}, navigation_discarded: bool, saved, save_error } -- navigation_discarded:true means every direction ended on Escape so the subobject was dropped, exactly as the Designer does; current_navigation is then all-Escape.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| save | No | Compile + save the Widget Blueprint when done (default true). | |
| force | No | Optional. This command is REFUSED while a Play-in-Editor session is running: it either compiles a Blueprint (the reinstancer can retain a world, and CheckForWorldGCLeaks is Fatal -- it KILLS the editor) or writes to disk (Editor.AllowSavingAssetsDuringPIE=0 makes the engine refuse the write, so it would report success without writing a byte). Stop PIE and retry instead; force=true runs it anyway, at your own risk. | |
| rules | No | Dict of {direction: rule}. Direction is Up|Down|Left|Right|Next|Previous (Next/Previous are Tab/Shift+Tab). The value is either a rule name string ("Wrap", "Stop", "Escape") or an object {"rule":"Explicit","widget_to_focus":"Btn_Confirm"} when the rule needs a target. Rules: Escape (default -- let the search continue outward), Stop (movement dies here), Wrap (cycle inside the container), Explicit (jump to widget_to_focus). | |
| widget_name | Yes | Name of the widget in the tree whose navigation to author | |
| all_directions | No | Optional rule name applied to ALL SIX directions before `rules` is processed, so you can say "Stop everywhere, except Down" in one call. Explicit is refused here: it would need six different targets. | |
| blueprint_name | No | Alias of `widget_bp_path` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `widget_bp_path`. | |
| widget_bp_path | No | /Game path of the Widget Blueprint asset |