Just plain help - Timer

Also I can go to level 2 but when I enter the hit box in level two it takes me back to the start of level 2, why doesn’t

the next level variable change-is vent begin play only once and not every level?

ahh thats clever, yh idk what I was tryna do with that

I can get the level timer and game time working, but the level time goes like (completed level 1) - Level_1:XX:XX:XX but when I complete level 2 it deletes that number, any help? (Sorry I can’t do anything myself its just this is my first time using timers)

It does not work because you do not even run the loop, you enter, skip Loop Body iteration altogether and exit, returning no values.

Also, bound functions execute every frame, what you’re doing is quite inefficient. Avoid casting on Tick as it does eventually add up.

And the Format Text node makes little sense, have a look here:


Here’s a quick and dirty version with widgets:

There are 2 widgets here, the first one is the TimeList - it has a single function:

It adds an entry (creates another widget) to its own list (a vertical box) and returns that widget’s reference.

The second - Time Entry - widget is just a text box with a single string variable bound to the text block.


It all happens in the Next Level actor:

  • Begin Play creates the widget list
  • it add as many entries as there are string timers
  • and it creates 2 additional entries to show Game Time and Current Level Time

Tick updates the 2 above-mentioned entries with the data pulled from the game instance.

In action:

Image from Gyazo

Not sure how much more I can assist your with this as it’s been a time consuming ride; I did zip the project and it’s available here if you wish to have a look:

https://drive.google.com/open?id=1R2rtKrpK90ulWmsDS2I8AK_F80HFi1UU

It’s for UE 4.24, btw.

When you open a level, the only actor that persists is the Game Instance. New level means a new instance of the game mode - your data resets.

Also, are you sure you want to cascade branches like this? What if you have 100 levels?

Why not use what I suggested - the Next Level actor has a level name variable - make it Instance Editable so you can do this in every level:

And then you can have the Next Level actor open a new level, like so, bottom right:

This way any level can lead to any other level. You can even have multiple exits or have a level chosen at random!


If you do not want to do it like this, have the Level List array in the Game Instance instead and increase index by one every time the level changes, fetching the appropriate level name.

Haha, get some sleep! :slight_smile: