# trying to be efficient with bpi interfaces and event dispatcher on my endless runner

**URL:** <https://forums.unrealengine.com/t/trying-to-be-efficient-with-bpi-interfaces-and-event-dispatcher-on-my-endless-runner/1806965>\
**Category:** Blueprint\
**Tags:** casting, unreal-engine, sequence, Blueprint, question\
**Created:** [April 16, 2024, 8:07pm UTC](https://forums.unrealengine.com/t/trying-to-be-efficient-with-bpi-interfaces-and-event-dispatcher-on-my-endless-runner/1806965 "2024-04-16T20:07:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![franckys](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@franckys](https://forums.unrealengine.com/u/franckys)\
**Post date:** [April 16, 2024, 8:07pm UTC](https://forums.unrealengine.com/t/trying-to-be-efficient-with-bpi-interfaces-and-event-dispatcher-on-my-endless-runner/1806965/1 "2024-04-16T20:07:48Z")

</div>

In this section of the blueprint I was trying to implement BP interfaces or even dispatchers in place of the cast which I know is very memory heavy but for one reason or another it doesn’t work i tryed different approach but there is always something not working here’s some tryes let me know any mistakes or error i might have committed

before:

 ![Immagine WhatsApp 2024-03-30 ore 10.55.24_c0d610a4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/0/7/e07e7a0db79bb9b5c82d1b88e5f9f1b325609483.jpeg)

after that i tried this but it does nothing:

 ![Immagine WhatsApp 2024-04-13 ore 10.35.30_3e86e174](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/9/89969314d8c2f2557c36ab5ec62a9ced7ce3fe66.jpeg)  
in every node there is a check for tag and a branch.  
now i’m using this but after the first butch of coin spawned they dont spawn anymore  
 ![Immagine WhatsApp 2024-04-13 ore 10.50.45_592a464e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/5/5/0551813d499bb744e79f7cd458a5d86e2e4bdf9c.jpeg)

 ![Immagine 2024-04-16 203157](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/a/f/faf92643fae781cfea5aeb465f9a98e4ec3e1a23.png)

The logic behind this code was that for each different type of object with which the Coin went to overlap it should behave differently.

 ![Immagine 2024-04-16 204939](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/1/b/11b6fef16bc83950bb7f4db82df7e15cdafcc8bf.png)

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [April 16, 2024, 11:51pm UTC](https://forums.unrealengine.com/t/trying-to-be-efficient-with-bpi-interfaces-and-event-dispatcher-on-my-endless-runner/1806965/2 "2024-04-16T23:51:24Z")

</div>

so the interface is just a message

on overlap call the interface and nothing else, no casts, no tags, no checks.

then in the target implement the interface and handle your logic there

so in your high obstacle on interface call it destroys itself  
then on you low obstacle on interface call it moves up etc.

you can put a return value on the interface call, lets call it bSuccess and on success the coin can destroy itself
