Hi,
I am having trouble with binding functions to the InputTouchBegin event for an AActor
and it’s UPrimitiveComponent
.
Header:
UFUNCTION()
void OnComponentTouchBegin(ETouchIndex::Type FingerIndex, UPrimitiveComponent* TouchedComponent);
UFUNCTION()
void OnActorTouchBegin(ETouchIndex::Type FingerIndex, AActor* TouchedActor);
Constructor:
Mesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh Component"));
if (Mesh) {
RootComponent = Mesh;
Mesh->OnInputTouchBegin.AddDynamic(this, &ACustomActor::OnComponentTouchBegin);
}
this->OnInputTouchBegin.AddDynamic(this, &ACustomActor::OnActorTouchBegin);
All of the respective Project / Player Controller touch input settings are enabled. I have confirmed this by running the code in blueprint first (below).