RealDocs

UButton::OnClicked

property UMG Blueprint Since 4.0
#include "Components/Button.h"
Access: public Specifiers: UPROPERTYBlueprintAssignable

Description

Multicast event broadcast when the user completes a click on the button, per the button's configured ClickMethod.

Caveats & Gotchas

  • This is the event to use for click handling — do not try to detect clicks by polling IsPressed each frame.
  • Whether this fires on mouse-down or mouse-up (and how touch/gamepad map to it) depends on SetClickMethod, SetTouchMethod, and SetPressMethod, not a fixed 'click' definition.

Signature

UPROPERTY(BlueprintAssignable, Category="Button|Event")
FOnButtonClickedEvent OnClicked;

Example

Bind a native handler to OnClicked C++
MyButton->OnClicked.AddDynamic(this, &AMyHUD::HandleButtonClicked);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.