Hi all, I’m having an issue in 4.7.4 with line trace debugging. I can get my linetrace fine when debugging a typical FString “You are looking at something”, but when trying to debug hit.GetActor()->GetName(), once I look at something, editor freezes. I may be missing something. I’m calling my GetTrace function from Tick. I’ve tried removing the GetTrace function and just moving the logic to Tick, same deal.
// Called every frame
void AFPSChar::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
GetTrace();
}
void AFPSChar::GetTrace()
{
FCollisionQueryParams params;
params.bReturnPhysicalMaterial = true;
params.bTraceComplex = true;
params.bTraceAsyncScene = true;
params.AddIgnoredActor(this);
FHitResult hit;
if(DoTrace(params, hit))
{
GEngine->AddOnScreenDebugMessage(0, 1, FColor::Red, hit.GetActor()->GetName());
}
}
bool AFPSChar::DoTrace(FCollisionQueryParams TraceParams, FHitResult HitResult)
{
FVector CamLoc;
FRotator CamRot;
GetActorEyesViewPoint(CamLoc, CamRot);
FVector Start = CamLoc;
FVector End = CamLoc + CamRot.Vector() * TraceDistance;
return GetWorld()->LineTraceSingle(HitResult, Start, End, ECC_PhysicsBody, TraceParams);
}