Execute function on line traced object

Hey everyone, I’m trying to set up a way of interacting with the world. In order to make it expandable I was hoping to use a line trace to be looking out for objects. When a button is pushed it will take that object and attempt to execute a function on that blueprinted object. Each object would implement that function in its own way. Since it would be multiple blueprints it is looking out for, is there anyway to do this without having to cast to a specific blueprint type, there could also be multiples of the same blueprint?

Is there a better way even?

You can use Interfaces and/or inheritance (virtual methods).

You can add tags to actors like , then when you pull off of Hit Actor on the Break Hit Result node you can do Actor has Tag . If true do this event, if false do that event. Or even if false > Actor has tag again, so on and so forth.

Wow, I love unreal. It seems like I never have to do any weird rigging to get things working.

For anyone finding this post: - YouTube

Does this work with replication though? It will be for multiplayer. Switching out the interface with a custom event doesn’t allow for a generic actor class to be passed, and each custom event seems to only work for the blueprint that it was made in.