How to use "OnActorBeginOverlap" inside the HUD ?

How to use “OnActorBeginOverlap” inside the HUD ?

I have a normal HUD. I Added a function called “Draw Time” This function draw a timer inside the HUD, counting from 0:60 seconds to 0:00 seconds.

Now the trick part: I need to ONLY CALL the “Draw Time” Function, inside the HUD, if the player character overlap a trigger box inside the level.

Any ideas on how to do this ?

OnActorBeginOverlap did not work in HUD. I already try this.

Help me please!

Tks alot !

Though the HUD is an Actor, I don’t think it has a collision component, which could check the overlap.

You should check the Begin Overlap Event inside the trigger box. This event spits out the character pawn actor, if you walk inside it. From there you can cast to the PlayerController and the HUD and access your variables inside the hud class.

I would consider creating a boolean (e.g. “bDrawTime”) in your HUD class and only execute the DrawTime-Function, if that boolean is true (with a Branch).

Hope that helps.

What you mean on “you should check the Begin Overlap Event inside the trigger box” ? The trigger box is in the level , it´s already a trigger…

First off, thanks for giving a thumbs down for someone who is trying to help instead of asking or correcting first.

The blueprint of the Trigger-Box has an event “ActorBeginOverlap” (natively). You can see it in the picture I posted. This Event gives you the Actors that intersect with your Trigger-Box (ergo your character). From this character-actor you can get your PlayerController and (afterwards) your HUD.