How to trace Landscape collision?

Hello.

I try to use Spawn collision test using ECollisionChannel::ECC_GameTraceChannel1 .

Everything works perfectly except collision with Landscape.

I want to spawn actors on the water only but ECollisionChannel::ECC_GameTraceChannel1 do not recognised landscape collision and put my actors on the ground.

There is no options to block landscape collision in ProjectSettings.

Is there any way to solve this issue ?

UP this issue.

When I want to spawn some actor above the Landscape and using ECollisionChannel::ECC_GameTraceChannel1 - for checking collisions.
This recognized all collisions with other actors but not with Landscape and spawned actors spawn inside Landscape.

bool USpawnVolumeBox::CanSpawnAtLocationSphere(FVector Location, float Radius)
{
FHitResult HitResult;
FVector aLocation = GetComponentToWorld().TransformPosition(Location);

bool HasHit = GetWorld()->SweepSingleByChannel(
	HitResult,
	aLocation,
	aLocation,
	FQuat::Identity,
	ECollisionChannel::ECC_GameTraceChannel1,
	FCollisionShape::MakeSphere(Radius)
);

FColor ResultColor = HasHit ? FColor::Red : FColor::Green;
DrawDebugCapsule(GetWorld(), aLocation, 0, Radius, FQuat::Identity, ResultColor, true, 100);
return !HasHit;

}

Maybe someone know how to solve it ?

Privacy & Terms