Score based upon time

Hi,
I’m wanting to create a scoring system, where a character is in a trigger box and gets points based upon the amount of time in that box. I’ve already got it so I can have a set number of points, like 10 for example, and bring that up on the HUD, but I can’t figure out how to do that based upon time.

Can someone give me advice, please?

Hi! In fact it depends on how often you want to update your score^

  • If you want to get updated score value every frame then Tick is your only possibility

  • If you want to get updated score value often but not every frame then you can use Timers (Using C++ Timers in Unreal Engine - Tom Looman)

  • If you only want to get FINAL updated score value then just use Begin Overlap and End Overlap overrides

And anyway there is something like GetWorld()->GetTimeSeconds(UWorld::GetTimeSeconds | Unreal Engine Documentation)

A lot of ways to do this; for example: in the Trigger Box actor:


You could, of course, have similar logic in the player instead and check what they stepped into.

Thanks for your help!

Thank you :slight_smile: