Timer Question
Hi all,
I am trying to make a timer that counts down from 20 to 0,but every time you do a certain task you add on another 5 seconds
so you can prevent it getting to 0. If the time reaches 0 it's game over.
I would normally use interpolate for a countdown but it seems to need a pre-determined number to countdown from.
Any ideas would be greatly appreciated.
I am trying to make a timer that counts down from 20 to 0,but every time you do a certain task you add on another 5 seconds
so you can prevent it getting to 0. If the time reaches 0 it's game over.
I would normally use interpolate for a countdown but it seems to need a pre-determined number to countdown from.
Any ideas would be greatly appreciated.
It’s not a bug – it’s an undocumented feature
Best Answer
-
Braydon_SFX Posts: 9,273
Create an integer attribute called Time - set this to 20.
Then, create a Round Rules actor which will be placed on the scene where the player cannot see it.
Go into the actor and put a timer:
Every 1 second,
change attribute game.Time to game.Time-1
This will decrease the time by one second every second.
Then, you would just add 5 seconds to the attribute when needed etc.
Hope this helps.My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Answers
It’s not a bug – it’s an undocumented feature