Widgets are based UMG UI technology. They are blueprint assets inherited from User Widget class.
Widgets can be used for displaying just a simple static text as well as complex spaces full of interactive elements (like we know e.g. from a web space). They are most used type of displaying Ui in the Unreal Engine.
Creating a Blueprint Widget
Widget Blueprintcan be added by right mouse button click inContent Drawerand selectingUser Interface→Widget Blueprint.Editor Utility Widgetcan be created by right mouse button click inContent Drawerand selectingEditor Utilities→Editor Utility Widget.
Blueprint Widget viewer & editor
Any Widget is being opened in a BP Widget editor containing Designer and Graph tabs.
Designertab is for designing UI of the WidgetGraphtab is for adding Blueprint functionality allowing to make the widgets interactive
Designer tab is composed of many windows, the most important are:
Pallet- is a library of components that can be used for creating the UI (Text, Image, Slider, Sound...)Hiearchy- displayes components hiearchy from which the widget is composed. It's created by adding components fromPalletinto the Widget UI.
Widget's components architecture
Widgets are Blueprint assets containing many pre-created components, such as Button, Slider etc. Each Widget is a componet itself and such as it can be placed into another Widget.
In practice, we can make a widget with custom graphics for each default component (button, slider...) and then use these Widgets in parent's widget instead of default component - by that way, each component in any widget will have same design and anytime we adjust the design in the component widget, it will be automatically reflected in all widgets withich which the component has been used. Such "default" widgets (used as simple components) can be placed in Widgets/Utilities folder, while complex widgets (composed of the utilities) can be placed in the Widgets folder.
Interaction with Menu Widget
Interactions of any kind in Unreal Engine require properly set Collision Presets. For Menu Widgets, follow the guide below:
Definition of
3DWidgettrace channel in collisionsIn
Edit→Project Settings→Collision, check whether there is defined3DWidgetor similarTrace channelsupposed for widgets interaction. If not, pressNew trace Channelbutton and add a new tracce channel withDefault Response:IgnoewSetting Collision Presets on the Menu Widget
Set collission preset
3DWidgettoBlockfor the widget.Widget Interaction component on Controllers
In your character pawn (e.g.
VRPawn), set trace Channel3DWidgetonWidget Interaction components.