# \[Resolved\] Checking raycast on multiple objects

**URL:** <https://forums.unrealengine.com/t/resolved-checking-raycast-on-multiple-objects/448418>\
**Category:** Blueprint\
**Tags:** Raycast, object-picker, actor, raycasting, unreal-engine, Blueprint, question\
**Created:** [May 5, 2019, 11:15am UTC](https://forums.unrealengine.com/t/resolved-checking-raycast-on-multiple-objects/448418 "2019-05-05T11:15:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![WilfreGD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WilfreGD](https://forums.unrealengine.com/u/WilfreGD)\
**Post date:** [May 5, 2019, 11:15am UTC](https://forums.unrealengine.com/t/resolved-checking-raycast-on-multiple-objects/448418/1 "2019-05-05T11:15:02Z")

</div>

Hello,  
I am working on a project where i want the player to interact with multiple objects, maybe hundreds. Where i can’t find a solution is for the many different interactions. Here, for example, i have a key, the player can pick it up, there is a button that the player can press to activate a cutscene, a monster with dialogs, and there are sprites which shows some text on screen. But each object has to be activated when the raycast hits them. So when the raycast hits something, it has to check if it is one of the many blueprint classes and call their function.  
But i don’t think checking for each class is a good idea, it doesn’t look good and i can’t find another way…  
I can’t loop because when i need to access the “Raycast Function” function inside of these blueprints, it requires a reference. So, if i had hundreds of interactions in the game, the blueprint would be massive and will check if the object is one of the others before.

 ![276044-raycast.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/c/0/ac0ed2e78e96e1600a954ead2e75d4205b2c5346.png)

---

<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:** [May 5, 2019, 11:18am UTC](https://forums.unrealengine.com/t/resolved-checking-raycast-on-multiple-objects/448418/2 "2019-05-05T11:18:26Z")

</div>

You’re looking for this:

> **[Blueprint Interface](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Types/Interface/)**
>
> Blueprints that declare functions to define an interface between Blueprints.

---

<div class="post-metadata">

**Author:** ![WilfreGD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WilfreGD](https://forums.unrealengine.com/u/WilfreGD)\
**Post date:** [May 5, 2019, 11:36am UTC](https://forums.unrealengine.com/t/resolved-checking-raycast-on-multiple-objects/448418/3 "2019-05-05T11:36:38Z")

</div>

Awesome! It works perfectly, thank you 🙂
