ActorLineTraceSingle() returning inaccurate hit result

Hi, I’m trying to align a spline onto the surface of a landscape by using landscape->ActorLineTraceSingle() to get the Z location on the landscape at all the spline points. However, though all the spline points are near the surface of the landscape, most of the spline points are not exactly on the surface.
Is this supposed to happen or am I doing something wrong?

The following is the code I’m using.

FCollisionQueryParams collision = FCollisionQueryParams(FName(TEXT("trace")), true, this);
if (landscape != nullptr && landscape->ActorLineTraceSingle(hit, FVector(x, y, 100000), FVector(x, y, -100000), ECC_Visibility, collisionParams))
{
  z = hit.Location.Z;
}

Not an expert with landscapes…but I wonder if the collision geo doesn’t always match the render geo? Can you turn on collision debug and see if the points are landing there?

Hi, I’m not sure if I’m turning on collision debug but I have added a TraceTag to the FCollisionQueryParams and there seems to be upward arrows between the surface of the landscape and the spline points beneath the surface. What does it mean?

Can you post a screenshot?

I’m sorry but I’m doing this project on a secured network so I am unable to provide any screenshot or photo.