# Multi line trace returning no hit results

**URL:** <https://forums.unrealengine.com/t/multi-line-trace-returning-no-hit-results/338645>\
**Category:** World Creation\
**Tags:** Raycast, overlap, channel, unreal-engine, Collision, question\
**Created:** [November 16, 2015, 12:46pm UTC](https://forums.unrealengine.com/t/multi-line-trace-returning-no-hit-results/338645 "2015-11-16T12:46:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_d0b50950](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d0b50950](https://forums.unrealengine.com/u/anonymous_user_d0b50950)\
**Post date:** [November 16, 2015, 12:46pm UTC](https://forums.unrealengine.com/t/multi-line-trace-returning-no-hit-results/338645/1 "2015-11-16T12:46:12Z")

</div>

Been trying to get ray trace to return every actor hit. I am using UShapeComponents for collision detection, I disable every channel on my meshes and activate them on the ShapeComponents instead. I am using ECR\_Overlap but I am getting nothing hit. I tried making the ECC\_ObstacleChannel block but it only returns one of the actors that get hit, not even the first (might depend how they get added to the scene). Any idea what is missing? Thanks.

```
void IObstacleInterface::BeginObstacle()
{
	GetMeshComponent()->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore);

	ShapeComponent = GetCollisionShape();
	ShapeComponent->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Overlap);
}

```

In the Tick event…

```
		TArray<FHitResult> ObstacleHitResults;
		ObstacleHitResults.Init(FHitResult(ForceInit), 3);
		FCollisionQueryParams ObstacleCollisionQueryParams = FCollisionQueryParams(FName(TEXT("Trace")), true, MeshComponent->GetAttachmentRootActor());
		ObstacleCollisionQueryParams.bTraceComplex = false;
		ObstacleCollisionQueryParams.bReturnFaceIndex = false;
		ObstacleCollisionQueryParams.bReturnPhysicalMaterial = false;
		ObstacleCollisionQueryParams.AddIgnoredActor(OverlappedObstacle);

		FCollisionResponseParams CollisionResponseParams = FCollisionResponseParams(ECollisionResponse::ECR_Overlap);

		if (MeshComponent->GetWorld()->LineTraceMultiByChannel(ObstacleHitResults, Current + FVector(0, 0, 50), Target + FVector(0, 0, 50), ECC_ObstacleChannel, ObstacleCollisionQueryParams, CollisionResponseParams))
		{

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d0b50950](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d0b50950](https://forums.unrealengine.com/u/anonymous_user_d0b50950)\
**Post date:** [November 17, 2015, 1:15am UTC](https://forums.unrealengine.com/t/multi-line-trace-returning-no-hit-results/338645/2 "2015-11-17T01:15:04Z")

</div>

Okay, my problem was the if statement. It only returns true when something collided with is Blocking. So I just removed the if and always execute the loop after to process the collided actors.

---

<div class="post-metadata">

**Author:** ![salm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@salm](https://forums.unrealengine.com/u/salm)\
**Post date:** [November 5, 2017, 5:24pm UTC](https://forums.unrealengine.com/t/multi-line-trace-returning-no-hit-results/338645/3 "2017-11-05T17:24:44Z")

</div>

This saved me alot of trouble, thanks.

---

<div class="post-metadata">

**Author:** ![MadeInAm3rica](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MadeInAm3rica](https://forums.unrealengine.com/u/MadeInAm3rica)\
**Post date:** [August 20, 2018, 9:02am UTC](https://forums.unrealengine.com/t/multi-line-trace-returning-no-hit-results/338645/4 "2018-08-20T09:02:39Z")

</div>

Wish I found this sooner!
