How to call a function in ANY object

I am quite new to the UE4 but I have some experience with blueprint scripting. And I was wondering if there is a way to make a function (or something like that) that could be called in any object.

I have in mind something like Damage mechanics, which can be called in any object and that would fire an event in that obect. It doesn’t matter which object.

Normal functions don’t work for me (as far as I know) because I have to do casting to get that object’s reference.

Something like that would be realy handy and I would apreciate any help.

Thank you!

make a blueprint interface, then you can call any of those interface functions on any object, and if the object implements that interface, its event will fire. if it doesn’t implement the interface, nothing will happen. this way you don’t need to cast when communicating to unknown objects.

The interface is definitely what you’re looking for. I would add though that Unreal does have a built in damage system (n.b., I have not used it yet). Check out the event “PointDamage” in the blueprint editor.