AActor::OnBeginCursorOver
#include "GameFramework/Actor.h"
Access: public
Specifiers: UPROPERTYBlueprintAssignable
Description
Delegate fired when the mouse cursor moves over this actor while mouse-over events are enabled in the PlayerController. Bind handlers here instead of overriding the C++ notification.
Caveats & Gotchas
- • Mouse-over events require bEnableMouseOverEvents = true on the PlayerController. Without this, the delegate never fires regardless of cursor position.
- • Mouse-over detection uses the actor's collision shape. Actors without collision (or with collision disabled) will not receive cursor-over events even if visually under the cursor.
- • In UMG-heavy projects, UI elements capturing mouse input will block mouse-over events from reaching actors in the world. Ensure the input mode allows mouse-over passthrough.
Signature
UPROPERTY(BlueprintAssignable, Category="Input|Mouse Input")
FActorBeginCursorOverSignature OnBeginCursorOver; Example
Bind cursor-over handler in BeginPlay C++
void AMyActor::BeginPlay()
{
Super::BeginPlay();
OnBeginCursorOver.AddDynamic(this, &AMyActor::HandleCursorOver);
}
void AMyActor::HandleCursorOver(AActor* TouchedActor)
{
// Highlight the actor
MeshComponent->SetRenderCustomDepth(true);
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?