UButton::IsPressed
#include "Components/Button.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallableconst
Description
Returns true while the user is actively holding the button down.
Caveats & Gotchas
- • Do not use this to detect clicks — a press-and-release sequence should be handled with the OnClicked event, not by polling IsPressed each frame.
- • Reflects the current live interaction state; it is not a substitute for OnPressed/OnReleased if you need to react at the moment the state changes.
Signature
UFUNCTION(BlueprintCallable, Category="Button")
UMG_API bool IsPressed() const; Return Type
bool Example
Poll press state for a hold-to-charge mechanic C++
if (MyButton->IsPressed())
{
ChargeAmount += DeltaTime;
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?