Hey, so I’ve got to the point where I need to be able to create listeners and notifiers within a lot of my classes. Currently I’m use c++ to do this with _raise and _event:
It’s easy to use but I’d like to use UE4s way of doing this as well, providing that it will work in c++ just as well as blueprints.
I’ve noticed this:
CollisionComp->OnComponentHit.AddDynamic(this, &AThe_Battle_Of_MaldonProjectile::OnHit); // set up a notification for when this component hits something blocking
which appears to be like this in my code:
__hook(&EventSource::AttackActionEvent, pSource, &EventReceiver::AttackActionEvent);
Where the method of OnComponentHit, the notifier/event, is run from the CollisionComp and also passed into the method OnHit, the listner, of AThe_Battle_Of_MaldonProjectile.
What what I have to do to set this up? Does ‘AddDynamic’, automatically hook OnComponentHit to OnHit or do I need to change something in OnComponentHit?