RealDocs

AActor::NotifyActorOnInputTouchBegin

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

Description

Called when this actor is touched by a finger when click events are enabled in the PlayerController. Override to respond to touch-begin input on this specific actor.

Caveats & Gotchas

  • This is only called when click events are enabled in the PlayerController via bEnableClickEvents and bEnableTouchEvents — actors won't receive these notifications by default.
  • The C++ virtual and the Blueprint event (ReceiveActorOnInputTouchBegin) are separate. Overriding the virtual in C++ does not suppress the Blueprint event from firing.
  • Input must not be consumed by UI or another higher-priority handler; if touch events are blocked upstream, this function will never fire.

Signature

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

Parameters

Name Type Description Default
FingerIndex const ETouchIndex::Type Which finger triggered the touch event (Touch1 through Touch10).

Return Type

void

Example

Override to respond to touch begin C++
void AMyActor::NotifyActorOnInputTouchBegin(const ETouchIndex::Type FingerIndex)
{
	Super::NotifyActorOnInputTouchBegin(FingerIndex);
	if (FingerIndex == ETouchIndex::Touch1)
	{
		// React to primary finger touch
		ActivateActor();
	}
}

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.