# How to get the Closest interact between to actor?

**URL:** <https://forums.unrealengine.com/t/how-to-get-the-closest-interact-between-to-actor/359697>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 5, 2016, 9:45am UTC](https://forums.unrealengine.com/t/how-to-get-the-closest-interact-between-to-actor/359697 "2016-06-05T09:45:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_bfcf75ef](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bfcf75ef](https://forums.unrealengine.com/u/anonymous_user_bfcf75ef)\
**Post date:** [June 5, 2016, 9:45am UTC](https://forums.unrealengine.com/t/how-to-get-the-closest-interact-between-to-actor/359697/1 "2016-06-05T09:45:36Z")

</div>

How can I do to get the closest interact between the caracter and other two actor? I try with a simple interact system which allows the player to interact with actors through their collisionspheres but it doesn’t work well so I need an interaction system based on the skeletal mesh distance. Can anyone help me?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bfcf75ef](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bfcf75ef](https://forums.unrealengine.com/u/anonymous_user_bfcf75ef)\
**Post date:** [June 5, 2016, 1:23pm UTC](https://forums.unrealengine.com/t/how-to-get-the-closest-interact-between-to-actor/359697/2 "2016-06-05T13:23:07Z")

</div>

yeah, but I need, if possible, a system that finds the nearest pickup when the player walks near it so I don’t need the camera’s field of view

---

<div class="post-metadata">

**Author:** ![Dodgin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dodgin](https://forums.unrealengine.com/u/Dodgin)\
**Post date:** [June 5, 2016, 3:41pm UTC](https://forums.unrealengine.com/t/how-to-get-the-closest-interact-between-to-actor/359697/3 "2016-06-05T15:41:13Z")

</div>

[https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseRaycasts/Blueprints/#shapetraces](https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseRaycasts/Blueprints/#shapetraces)

🙂

You can do multitrace shape traces too :V

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bfcf75ef](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bfcf75ef](https://forums.unrealengine.com/u/anonymous_user_bfcf75ef)\
**Post date:** [June 6, 2016, 8:50am UTC](https://forums.unrealengine.com/t/how-to-get-the-closest-interact-between-to-actor/359697/4 "2016-06-06T08:50:47Z")

</div>

I solved the problem without traces: i used a capsule witch detects any pickup that collides with it and sets the nearest as best pickup. Then if the best pickup changes, it unfocus the old and focus the new

 ![93548-cattura.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/6/5/665a132ec79ba6de1e36124afa5123bac11908e8.png)

 ![93549-cattura2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/5/9/e59ab9ba3a16031fad7ecb36db11e6bc46ba62c3.png)

 ![93550-cattura3.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/3/3/7336ce98b759230d5f341d50611127bcd5f5157d.png)
