Instead of making it an int, make it a float and every tick simply add the delta time that you get from the function. As it grows you can update a string variable if you want.
To format it you can take the float you saved, cast it to an int and divide it with 60 to get the num minutes. Save this new value as a variable numMin. Then take the same value and modulo it with 60 and the result is the number of seconds. As such, store this value as a variable called numSec.
Then you can combine them into a string by concatenating them. Finally just set the relevant variable to the resulting string.
The following question might be really “newbie” for many of you, but I just started using UE4 and learning how Blueprint works, so don’t be mean.
Let’s say for example, I have an Event Tick made to add 1 to a variable (Integer) every second, just like a timer would and want to make it into a String but also giving it a format, like mm:ss (As I said earlier, I’m going to use the timer as an example).
How do I make my Integer variable become a String, change that String as I specify and do the maths needed?
Thank you for reading,
Sebastián.
P.D: I’m installing Visual Studio support tomorrow, so if I need to personally code it won’t be a problem, but just wanted to know how this Blueprint Scripting works.
Thank you for your answer and for the example!
Really helped while using the “Floor” method as I never knew it’s existance, you really explained it perfectly.
But what I needed was to make it into a String and also wanted to know how Math works in UE4, as explained before, it’s my first time using an engine and I’m just learning some of the basics needed for it (I still think it’s easier to manually code it, but maybe because I’m used to it).