# How Do I Get MultiSphereTraceByChannel In C++

**URL:** <https://forums.unrealengine.com/t/how-do-i-get-multispheretracebychannel-in-c/384923>\
**Category:** C++\
**Tags:** multicast, unreal-engine, UE4, CPP, question\
**Created:** [February 14, 2017, 5:24pm UTC](https://forums.unrealengine.com/t/how-do-i-get-multispheretracebychannel-in-c/384923 "2017-02-14T17:24:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_17f44ad41](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_17f44ad41](https://forums.unrealengine.com/u/anonymous_user_17f44ad41)\
**Post date:** [February 14, 2017, 5:24pm UTC](https://forums.unrealengine.com/t/how-do-i-get-multispheretracebychannel-in-c/384923/1 "2017-02-14T17:24:56Z")

</div>

As it says above. I’m moving a lot of my blueprints over to code and have come to this point. This is the Blueprint Node I’m trying to replicate in C++.

![126265-temp.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/3/793d52996f9c5aed0024510f970f6af24be23095.jpeg)

I needed to make a custom trace channel to make sure it registered all of the objects that it hits. Anyway, I know how to make a normal line trace and multi-line trace but I need some sort of Shape Trace Ideally a sphere. Im looking for what would be.

```
GetWorld()->SphereTraceMultiByChannel();

```

Any Suggestions / Solutions?

I found this answer but it’s for a single channel not a multi-channel and i can’t really make much sense of it if anyone else can, [How to make a Sphere Trace - C++ - Epic Developer Community Forums](https://answers.unrealengine.com/questions/130430/how-to-make-a-sphere-trace.html)

---

<div class="post-metadata">

**Author:** ![ExtraLifeMatt](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/extralifematt/32/918695_2.png) [@ExtraLifeMatt](https://forums.unrealengine.com/u/ExtraLifeMatt)\
**Post date:** [February 14, 2017, 6:15pm UTC](https://forums.unrealengine.com/t/how-do-i-get-multispheretracebychannel-in-c/384923/2 "2017-02-14T18:15:40Z")

</div>

What you want is [SweepMultiByChannel](https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Engine/UWorld/SweepMultiByChannel/index.html) which allows you to specify a start and end point, along with a shape.

So your code for a sphere based shape would look something like this:

```
FCollisionShape MySphere = FCollisionShape::MakeSphere(500.0f); // 5M Radius
TArray<FHitResults> OutResults;
GetWorld()->SweepMultiByChannel(OutResults, SweepStart, SweepEnd, FQuat::Identity, TraceChannel, MySphere);

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_17f44ad41](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_17f44ad41](https://forums.unrealengine.com/u/anonymous_user_17f44ad41)\
**Post date:** [February 15, 2017, 10:42am UTC](https://forums.unrealengine.com/t/how-do-i-get-multispheretracebychannel-in-c/384923/3 "2017-02-15T10:42:11Z")

</div>

Thanks, it works great I spent some time figuring out how to use my custom trace channel but it’s all good now, cheers.

---

<div class="post-metadata">

**Author:** ![SuryaPrakashModi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SuryaPrakashModi](https://forums.unrealengine.com/u/SuryaPrakashModi)\
**Post date:** [May 25, 2021, 7:21am UTC](https://forums.unrealengine.com/t/how-do-i-get-multispheretracebychannel-in-c/384923/4 "2021-05-25T07:21:04Z")

</div>

watch this. [How To Do Line Tracing Using C++ In Unreal Engine - YouTube](https://youtu.be/LWeQicz_teo)
