# Detecting blocks with linetraces

**URL:** <https://forums.unrealengine.com/t/detecting-blocks-with-linetraces/428817>\
**Category:** C++\
**Tags:** line-trace, raycasting, unreal-engine, CPP, question\
**Created:** [July 6, 2018, 10:31am UTC](https://forums.unrealengine.com/t/detecting-blocks-with-linetraces/428817 "2018-07-06T10:31:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_e7f95ee81](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e7f95ee81](https://forums.unrealengine.com/u/anonymous_user_e7f95ee81)\
**Post date:** [July 6, 2018, 10:31am UTC](https://forums.unrealengine.com/t/detecting-blocks-with-linetraces/428817/1 "2018-07-06T10:31:40Z")

</div>

I’ve been trying to code a wall climbing system, using _LineTraceSingleByChannel()_ to detect when the player is at a certain distance from a surface. But for some reason, the _OutHit.bBlockingHit_ always returns true, even when nothing is hitting the raycast. Do I need to initialize or reset the _OutHit_ at any point to make this work?

---

<div class="post-metadata">

**Author:** ![staticvoidlol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@staticvoidlol](https://forums.unrealengine.com/u/staticvoidlol)\
**Post date:** [July 6, 2018, 10:35am UTC](https://forums.unrealengine.com/t/detecting-blocks-with-linetraces/428817/2 "2018-07-06T10:35:47Z")

</div>

Are you adding the actor doing the trace to the ignored actors on your [FCollisionQueryParams](http://api.unrealengine.com/INT/API/Runtime/Engine/FCollisionQueryParams/index.html)?  
It’s possible you’re always hitting this actor depending on where you start the trace from.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e7f95ee81](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e7f95ee81](https://forums.unrealengine.com/u/anonymous_user_e7f95ee81)\
**Post date:** [July 6, 2018, 1:02pm UTC](https://forums.unrealengine.com/t/detecting-blocks-with-linetraces/428817/3 "2018-07-06T13:02:37Z")

</div>

I added it, and it worked. Thank you so much! I was wondering if you also knew any place that had some detailed documentation on the engine and it’s features (hopefully focused on the C++ perspective). The official docs really let me down sometimes (including this time).
