# How to rotate a box trace with the pawns rotation?

**URL:** <https://forums.unrealengine.com/t/how-to-rotate-a-box-trace-with-the-pawns-rotation/477771>\
**Category:** C++\
**Tags:** raycasting, player-rotation, unreal-engine, CPP, question\
**Created:** [January 25, 2021, 7:23pm UTC](https://forums.unrealengine.com/t/how-to-rotate-a-box-trace-with-the-pawns-rotation/477771 "2021-01-25T19:23:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![KielanT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KielanT](https://forums.unrealengine.com/u/KielanT)\
**Post date:** [January 25, 2021, 7:23pm UTC](https://forums.unrealengine.com/t/how-to-rotate-a-box-trace-with-the-pawns-rotation/477771/1 "2021-01-25T19:23:34Z")

</div>

Hi,  
I have a SweepMulitByChannel raycast that I want to rotate with the pawns rotation that it is attached to. It currently only stays in one rotation. How would I get it to rotate with the pawn?

Here’s the raycast code

```
bool hitSuccess = GetWorld()->SweepMultiByChannel(Hit, Location, Location, FQuat::Identity, ECollisionChannel::ECC_GameTraceChannel1, CollisionShape, Params);
	
	DrawDebugBox(GetWorld(), Location, CollisionShape.GetExtent(), FColor::Red, false);
```

---

<div class="post-metadata">

**Author:** ![KielanT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KielanT](https://forums.unrealengine.com/u/KielanT)\
**Post date:** [January 25, 2021, 8:39pm UTC](https://forums.unrealengine.com/t/how-to-rotate-a-box-trace-with-the-pawns-rotation/477771/2 "2021-01-25T20:39:36Z")

</div>

So My issue was that i was focusing on the debug lines, which doesn’t draw the exact box that the raycast is sending out. instead of having the start and end of the raycast the same (It was from a sphere trace tutorial), I just needed to calculate an end point and it works fine.
