RealDocs

AActor::NotifyActorOnInputTouchLeave

function Engine Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: virtual

Description

Called when a touch finger moves off this actor while touch-events are enabled. Use this to revert visual or state changes applied in NotifyActorOnInputTouchEnter.

Caveats & Gotchas

  • As with the Enter variant, requires bEnableTouchOverEvents on the PlayerController. If the actor is destroyed while a finger is over it, the Leave event may not fire.
  • Does not fire when the finger is lifted from the screen — that is NotifyActorOnInputTouchEnd. Touch-leave only fires when the finger slides off the actor while still in contact with the screen.

Signature

ENGINE_API virtual void NotifyActorOnInputTouchLeave(const ETouchIndex::Type FingerIndex);

Parameters

Name Type Description Default
FingerIndex ETouchIndex::Type Which finger (touch index) left the actor.

Return Type

void

Example

Revert touch hover feedback C++
void AMyActor::NotifyActorOnInputTouchLeave(const ETouchIndex::Type FingerIndex)
{
    Super::NotifyActorOnInputTouchLeave(FingerIndex);
    SetActorScale3D(FVector(1.0f)); // Restore normal scale
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.