Download

Auto-delegate collision handling to an ActorComponent in blueprints

I have several actors that share behavior. Specifically about when they are hit. I’d like to create a MyActorComponent and add that to the actors. Then I want any collisions that occurs on those actors to be handled by on hit handlers on MyActorComponent without having to explicitly call it. I know I could add the OnComponentHit to each actor blueprint and have it call a function on MyActorComponent, but it’s a minor nuisance to do that for all the different actors, so I was wondering if there was a way to do it without having to be so explicit. Somehow just tell MyActorComponent that anywhere it’s added, it receives collision events for that actor. Is there some way to do this?

In your component:

Capture.PNG

Excellent. That worked perfectly. Thanks!

This post is noted.