Calling on custom events through tracing

Let’s start by enabling you to toggle line trace for your character at the push of a button.

This is a blueprint that only has a static mesh (cube) and this custom event written within it:
image

Now we head to our Character bp (player) and make a button toggle line trace once like so.
This is the line trace logic:

After breaking the hit result of the trace we cast to our object bp and drag the custom event from it like so:


ddd

However, using the Cast method is not that practical when you have many different blueprints that all share the same custom event, for that matter, I heavily advise you to look into Blueprint Interfaces, they are fast, clean and practical. This would do it for now don’t worry.

2 Likes