RealDocs

UButton::SetAllowDragDrop

function UMG Blueprint Since 5.0
#include "Components/Button.h"
Access: public Specifiers: UFUNCTIONBlueprintCallable

Description

Enables or disables drag-and-drop detection on the button so it can respond to OnButtonDragDetected and related drag events.

Caveats & Gotchas

  • Drag detection and click detection compete over the same mouse-down gesture — a button with drag-drop enabled needs the user to move the mouse past a threshold before a drag starts, which can subtly change how a fast click feels.
  • The drag/drop delegates this enables (OnButtonDragDetected, OnButtonDragEnter/Leave/Over/Drop) are plain C++ multicast delegates, not BlueprintAssignable — they must be bound from C++, not wired up in the Blueprint graph.

Signature

UFUNCTION(BlueprintCallable, Category="Button")
UMG_API void SetAllowDragDrop(bool bInAllowDragDrop);

Parameters

Name Type Description Default
bInAllowDragDrop bool Whether this button should participate in drag-and-drop detection.

Return Type

void

Example

Enable drag-and-drop on a button C++
MyButton->SetAllowDragDrop(true);

Version History

Introduced in: 5.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.