How to call an Event?

Hi, I want to deal with a collision between a character and another actor, so when the player presses a button (Input Event) its character blueprint checks if it’s hitting another actor of a certain class (through Cast to) and then other functions about the impact are called.

However, to do that I think it would be interesting to call the Hit event when that button is pressed and do some filtering with flow control. So how can I call an event in Blueprints? It was possible in Kismet and UnrealScript, so I hope it’s here too.

Before thinking in calling events I did this in another way: a bool is set to true when that button is pressed and a timer makes it false after a little time; the Hit event was configured to check that bool and if it was true make the desired effects. However, this didn’t work most of the time, because although the character was touching and colliding the other actor, the Hit event had already happened many times when the button was pressed, so no effect would happen unless the character walked away and hit again. So maybe something that checks collision between actors on any time is a better solution for the whole thing, just some kind of Hit or collision checker event or function called every Tick.

Have you tried using Event Actor Begin Overlap, then casting the Other Actor to the class you want to check for. If you want a bigger radius of collision, you could create a capsule around the Actor then create a Event Begin Actor Overlap for that capsule in the Component sections of the blueprint.

Am I understanding the problem correctly?

Hello, SilentX’, thanks for the suggestion, I know it works because I tried it yesterday; I used Begin Overlap for that and solved the problem, since it’s the more continuous type of collision detection I was looking for.

Oh sweet, I’m glad that worked for you.

Use the delegates
FActorBeginOverlapSignature OnActorBeginOverlap;
FActorEndOverlapSignature OnActorEndOverlap;

To check the type of an object, just do, AnyObject::StaticClass(); As long as AnyObject is reflected, ::StaticClass() will return it’s type.

He asked for blueprint solution