PlayMaker Help & Tips > PlayMaker Help

[SOLVED] How to make a timer count to 60 rather than 100

<< < (2/2)

jeanfabre:
Hi,

 Ok, here we go. your misunderstanding of the situation is the following:

 a float is treated as a base 100 as default, because this is the way we count. If you want to think as a float representing the number of seconds of a time span, then you need to use specific function ( hours are base 24, minutes and seconds are base 60. While you can compute that yourself with simply math trick, c# has it all figured out for you already.

 So I made an action that wrap all this:

http://hutonggames.com/playmakerforum/index.php?topic=1711.0

In your case, the format you want to set is the following:

{1:D1}:{2:D2}:{3:D2}

and that will really show a time as we understand it ( seconds counting to 60 to increment 1 minute)

If you have difficulty with this formating concept, visit and msdn help ( in the thread above)

Bye,

 Jean

MrMitch:
Thank you very much Jean, it works perfectly :)

This should be really helpful for others as well.

Also thanks for explaining how each value is looked at within unity :)

Navigation

[0] Message Index

[*] Previous page

Go to full version