# Offset a line trace

**URL:** <https://forums.unrealengine.com/t/offset-a-line-trace/469720>\
**Category:** Rendering\
**Tags:** line-trace, linetrace, fvector, offset, unreal-engine, question\
**Created:** [August 14, 2020, 12:04am UTC](https://forums.unrealengine.com/t/offset-a-line-trace/469720 "2020-08-14T00:04:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_e5de42af](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e5de42af](https://forums.unrealengine.com/u/anonymous_user_e5de42af)\
**Post date:** [August 14, 2020, 12:04am UTC](https://forums.unrealengine.com/t/offset-a-line-trace/469720/1 "2020-08-14T00:04:34Z")

</div>

So I have a line trace that shoots from the socket of my gun, however because i can’t get a forward direction for a socket, I get the forward direction of the camera however this shoots straight into the ground. Is there a way I can offset a forward direction or is there a way I can get the forward direction for the socket?

```
if(CanShoot)
	{
		FVector Start = InHandWeapon->GetSocketLocation("FirePoint");
		FVector EndPoint = Start + (FPS_Cam->GetForwardVector() * ShotDistance);
		
		FHitResult HitResult;
		FCollisionQueryParams CQP;
		CQP.AddIgnoredActor(this);	

		GetWorld()->LineTraceSingleByChannel(HitResult, Start, EndPoint, ECC_WorldDynamic, CQP);
	}

```
