# 100 unit long line trace from object to character, how to?

**URL:** <https://forums.unrealengine.com/t/100-unit-long-line-trace-from-object-to-character-how-to/435036>\
**Category:** Blueprint\
**Tags:** Trace, line, unreal-engine, UE4, Blueprint, question\
**Created:** [October 4, 2018, 3:52pm UTC](https://forums.unrealengine.com/t/100-unit-long-line-trace-from-object-to-character-how-to/435036 "2018-10-04T15:52:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kalekarri](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kalekarri](https://forums.unrealengine.com/u/kalekarri)\
**Post date:** [October 4, 2018, 3:52pm UTC](https://forums.unrealengine.com/t/100-unit-long-line-trace-from-object-to-character-how-to/435036/1 "2018-10-04T15:52:57Z")

</div>

![255607-linetrace.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/a/3/ca3a2cbed6815154dd8f581132f578d80a896d44.png)

here is my beautiful drawing about the situation. so im casting a line trace from object to character, at the moment it goes straight to character with "end-\>getactorlocation(self), i want the trace be only 100 units long. should i make the end of the trace somehow to the right spot or manipulate the “break hit result” to tweak the distance?

thanks.

---

<div class="post-metadata">

**Author:** ![duderseb](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/duderseb/32/558202_2.png) [@duderseb](https://forums.unrealengine.com/u/duderseb)\
**Post date:** [October 4, 2018, 4:10pm UTC](https://forums.unrealengine.com/t/100-unit-long-line-trace-from-object-to-character-how-to/435036/2 "2018-10-04T16:10:49Z")

</div>

Could you get the distance off the TraceHit and Branch it to do something only if Dist\<=100?

---

<div class="post-metadata">

**Author:** ![kalekarri](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kalekarri](https://forums.unrealengine.com/u/kalekarri)\
**Post date:** [October 4, 2018, 4:20pm UTC](https://forums.unrealengine.com/t/100-unit-long-line-trace-from-object-to-character-how-to/435036/3 "2018-10-04T16:20:16Z")

</div>

i need the location of the point that the 100 unit reaches, so that doesnt work on this case =/

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 4, 2018, 5:29pm UTC](https://forums.unrealengine.com/t/100-unit-long-line-trace-from-object-to-character-how-to/435036/4 "2018-10-04T17:29:40Z")

</div>

Like this:

 ![255623-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/c/0/2c0590322ce79e29cac539dc426e2f23391465e0.png)

If you want to trace towards the player, just use the appropriate direction vector rather than the forward vector of the objects that does the tracing.

---

<div class="post-metadata">

**Author:** ![kalekarri](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kalekarri](https://forums.unrealengine.com/u/kalekarri)\
**Post date:** [October 4, 2018, 6:09pm UTC](https://forums.unrealengine.com/t/100-unit-long-line-trace-from-object-to-character-how-to/435036/5 "2018-10-04T18:09:38Z")

</div>

i found a solution, i tried a new node “get unit direction vector” as Everynone suggested. Thanks.

 ![255635-solution.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/d/a/bdac9decd4a11f2ed4f876da41274cd37c2936d9.png)
