AActor::OnEndCursorOver
#include "GameFramework/Actor.h"
Access: public
Specifiers: UPROPERTYBlueprintAssignable
Description
Delegate fired when the mouse cursor moves off this actor while mouse-over events are enabled in the PlayerController. Pair with OnBeginCursorOver to implement hover effects.
Caveats & Gotchas
- • The end cursor-over event may not fire if the actor is destroyed while the cursor is still hovering over it. Always guard against stale references in your bound handler.
- • If another actor (or UI) captures the cursor between the begin and end events, you may receive the end event without having received the begin — handle this gracefully in your hover state.
- • Like OnBeginCursorOver, bEnableMouseOverEvents must be true on the PlayerController.
Signature
UPROPERTY(BlueprintAssignable, Category="Input|Mouse Input")
FActorEndCursorOverSignature OnEndCursorOver; Example
Bind cursor-off handler to remove highlight C++
void AMyActor::BeginPlay()
{
Super::BeginPlay();
OnBeginCursorOver.AddDynamic(this, &AMyActor::HandleCursorOver);
OnEndCursorOver.AddDynamic(this, &AMyActor::HandleCursorOff);
}
void AMyActor::HandleCursorOff(AActor* TouchedActor)
{
MeshComponent->SetRenderCustomDepth(false);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?