Knowledge base
Search Blueprint patterns
Searching…
Knowledge base
Variables: MenuWidget (UserWidget subclass), bIsMenuOpen (bool).
InputAction MenuKey → FlipFlop → A (open): Branch(MenuWidget is null) → True: CreateWidget(WBP_Menu) → SetVariable(MenuWidget) → AddToViewport → SetInputMode_UIOnly → SetShowMouseCursor(true) → SetVariable(bIsMenuOpen=true). B (close): MenuWidget → RemoveFromParent → SetInputMode_GameOnly → SetShowMouseCursor(false) → SetVariable(bIsMenuOpen=false).
Key: Always check IsValid(MenuWidget) before calling RemoveFromParent. SetInputMode_UIOnly is on PlayerController. Don't re-create widget if it exists — just show/hide.