A way to replace a cast with an interface

Since casts are very expensive I decided to use an interface to replace it in the Bullet’s line trace function. instead of casting to the drone from the hit actor output pin have it use an interface instead. Select the blueprint option and select interface blueprint from the options. call it something like BPI_Bullet_Interact. open the interface blueprint and call the new interface: Bullet interact and add a boolean output pin; call it Has interacted. you are done with it. go to both the character and drone and select class settings and add the interface you created. open the interface in the drone and add Explode between the nodes already there. then go to the character bp and replace the drone cast out of the line trace hit actor and have it hook to the Bullet interact. Example below:

Privacy & Terms