Download

How to notify child actorcomponents about parent Actor's hit event

Hello,

I’ve a class like this;

class UMyclass : public UActorComponent ...

I’ll attach this component to an actor with collision enabled (i.e. the actor has a collision enabled component). The Actor class has a NotifyHit() functionality which is called whenever the collision component collides. This works.

The question is how do I notify my UMyClass component about this collision event?
I do not want to have a custom function which will be called inside NotifyHit(), and I don’t think this is a preferred way.

Cheers!

Another way I can think of is to create a custom event that broadcasts from NotifyHit(), and my component can listen to that event. But, I do not want to modify owning actor’s code. Is there any event that I’m missing or any other way to notify my custom actor component about this collision?