I’ve gotten it this far…
void APortsmouthCharacter::Interact()
{
APlayerController* PController = GetWorld()->GetFirstPlayerController();
FHitResult InteractHit;
FString Debug = "Interact Event Pressed";
UKismetSystemLibrary::PrintString(GetWorld(), Debug, true, false, FLinearColor((1.0f), (0.0f), (0.0f), (1.0f)), (3.0f));
// Line Trace to see what Object the Player is looking at
APortsmouthCharacter::TraceForward(PController, InteractHit, InteractDistance);
if (InteractHit.Actor != NULL)
{
const AActor* InActor = InteractHit.GetActor();
FString DebugActor = (InActor != NULL) ? InActor->GetName() : FString(TEXT("None"));
UKismetSystemLibrary::PrintString(GetWorld(), DebugActor, true, false, FLinearColor((1.0f), (1.0f), (0.0f), (1.0f)), (3.0f));
if (InActor->GetActorClass()->ImplementsInterface(UInteractInterface::StaticClass()))
{
FString DebugTest = "Actor Implements Interact Interface";
UKismetSystemLibrary::PrintString(GetWorld(), DebugTest, true, false, FLinearColor((1.0f), (0.0f), (0.0f), (1.0f)), (3.0f));
}
}
}