# Get Hit Result Under Cursor

**URL:** <https://forums.unrealengine.com/t/get-hit-result-under-cursor/474426>\
**Category:** World Creation\
**Tags:** Trace, cursor, hit-result, unreal-engine, question\
**Created:** [November 13, 2020, 2:24pm UTC](https://forums.unrealengine.com/t/get-hit-result-under-cursor/474426 "2020-11-13T14:24:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teapot\_Creation](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Teapot\_Creation](https://forums.unrealengine.com/u/Teapot_Creation)\
**Post date:** [November 13, 2020, 2:24pm UTC](https://forums.unrealengine.com/t/get-hit-result-under-cursor/474426/1 "2020-11-13T14:24:57Z")

</div>

Hey there,  
I’m using a Get Hit Result Under Cursor for Objects node, with a specific (custom) object type defined as a target.  
Shouldn’t this work only if the Object is directly under the cursor ? Hit result is valid even if the targeted object is hidden under static meshes or so.

---

<div class="post-metadata">

**Author:** ![LogierJan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/logierjan/32/88718_2.png) [@LogierJan](https://forums.unrealengine.com/u/LogierJan)\
**Post date:** [November 13, 2020, 2:46pm UTC](https://forums.unrealengine.com/t/get-hit-result-under-cursor/474426/2 "2020-11-13T14:46:01Z")

</div>

What the _Get Hit Result Under Cursor for Objects_ will do is perform a collision trace from the place where your cursor is away from the screen, and it will return the first object the trace hits that matches one of the _Object Types_ you specified.

So if the static meshes in front of your object are not of an object type specified in those _Object Types_ they will be ingored and the trace will go through untill it hits an object that matches the Object type.

If you want to check on all objects that are visible you can use _Get Hit Result Under Cursor by Channel_ with _Visibility_ as _Trace Channel_.

---

<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:** [November 13, 2020, 2:52pm UTC](https://forums.unrealengine.com/t/get-hit-result-under-cursor/474426/3 "2020-11-13T14:52:10Z")

</div>

> Hit result is valid even if the  
> targeted object is hidden under static  
> meshes or so.

On the contrary, that’s the whole point. It allows you to filter out the undesired results very efficiently.

* * *

Imagine a top-down game where one is supposed to click fish under the surface of water. You’re free to \*Get Hit Result Under Cursor for \ ***Fish** objects even though there’s water, boats, seaweed, turtles, sunken tree trunks and whatnot in the way.

You can _click through_ other things without worrying - they’re all being ignored.

---

<div class="post-metadata">

**Author:** ![Teapot\_Creation](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Teapot\_Creation](https://forums.unrealengine.com/u/Teapot_Creation)\
**Post date:** [November 13, 2020, 3:22pm UTC](https://forums.unrealengine.com/t/get-hit-result-under-cursor/474426/4 "2020-11-13T15:22:45Z")

</div>

Alright, I misunderstood that node, thanks to @LogierJan and @Everynone !

---

<div class="post-metadata">

**Author:** ![Teapot\_Creation](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Teapot\_Creation](https://forums.unrealengine.com/u/Teapot_Creation)\
**Post date:** [November 13, 2020, 3:26pm UTC](https://forums.unrealengine.com/t/get-hit-result-under-cursor/474426/5 "2020-11-13T15:26:47Z")

</div>

Subsidiary question here : is there a way to check objects type after a channel trace ? I want to check objects for visibility but only a certain type of object. No “get object type” node or similar…

---

<div class="post-metadata">

**Author:** ![Teapot\_Creation](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Teapot\_Creation](https://forums.unrealengine.com/u/Teapot_Creation)\
**Post date:** [November 13, 2020, 3:31pm UTC](https://forums.unrealengine.com/t/get-hit-result-under-cursor/474426/6 "2020-11-13T15:31:22Z")

</div>

Nvm I’ve found a way using interface implementation check. Thanks again !
