Hello, I want to be able to perform an ActionBind (pressing F for example) only when overlapped with a Trigger Volume.
void ABooCharacterBase::OnOverlapBegin(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
if (OtherActor && (OtherActor != this) && OtherComp)
{
Interact();
PopUp();
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("Overlap Begin"));
}
}
This is my Interact(); void based on “PlayerInputComponent->BindAction(“Interact”, IE_Pressed, this, &ABooCharacterBase::Interact);”:
void ABooCharacterBase::Interact()
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, TEXT("Pressed F"));
}
Hope I’ve provided enough information for a solution, thank you for your time.