Ya i tried a log here is the code. I think it was because i didnt use local X vector.
void AShooterCharacter::DetectLedge() const
{
FVector Location = GetActorLocation();
FVector TestLocation = Location + FVector(2,0,0);
FCollisionQueryParams TraceParams(TEXT(“DeathCamera”));
const bool bBlocked = GetWorld()->LineTraceTest(Location, TestLocation, ECC_Default, TraceParams);
if (!bBlocked)
{
UE_LOG(LogShooter, Log, TEXT("bBlocked"));
}
}