I’m trying to get the distance from an actor to the closest collider using the following code, however Hit.ImpactPoint always returns the same as GetActorLocation(). This also happens with SweepMulti. How can I get the collision point, or is there another way to get the distance?
FHitResult Hit;
FVector Location = GetActorLocation();
float Radius = 50;
if (GetWorld()->SweepSingle(Hit, Location, Location + FVector(0, 0, Radius), FQuat::Identity, FCollisionShape::MakeSphere(Radius), FCollisionQueryParams(FName("Outline"), false, this), FCollisionObjectQueryParams()))
{
GEngine->AddOnScreenDebugMessage(-1, 15, FColor::Blue, Location.ToString() + " - " + Hit.ImpactPoint.ToString());
}