AActor::OnReleased
#include "GameFramework/Actor.h"
Access: public
Specifiers: UPROPERTYBlueprintAssignable
Description
Multicast delegate fired when the left mouse button is released while the mouse is over this actor and click events are enabled in the player controller.
Caveats & Gotchas
- • The player controller's `bEnableClickEvents` must be true for this to fire. Forgetting this is the most common reason the delegate never fires.
- • OnReleased fires based on the mouse position at the time of button release — if the cursor has moved off the actor before release, this will not fire. Use the PlayerController's input bindings if you need a guaranteed release event.
Signature
UPROPERTY(BlueprintAssignable, Category="Input|Mouse Input")
FActorOnReleasedSignature OnReleased; Example
Bind a release handler in BeginPlay C++
void AMyActor::BeginPlay()
{
Super::BeginPlay();
OnReleased.AddDynamic(this, &AMyActor::HandleReleased);
}
void AMyActor::HandleReleased(AActor* TouchedActor, FKey ButtonReleased)
{
UE_LOG(LogTemp, Log, TEXT("Released %s on %s"), *ButtonReleased.ToString(), *GetName());
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?