LineTraceSingle Does Not Work!

Propably what you want to use is UWorld::LineTraceSingleByChannel.

Another option would be to use the UKismetSystemLibrary, it’s basically the same, just remember to include the header if you use it, here is an example:

FHitResult HitResult;
TArray<AActor*> actorsToIgnore;

const FVector& ActorLocation = GetActorLocation();
if (UKismetSystemLibrary::LineTraceSingle(this, ActorLocation, ActorLocation + FVector(0.0f, 0.0f, -500.0f), UEngineTypes::ConvertToTraceType(ECC_Camera), false, actorsToIgnore, EDrawDebugTrace::None, HitResult, true, FLinearColor::Red, FLinearColor::Green, 0.0f))
{
	return HitResult.Location;
}