Hi all, I am very new to Unity and Adventure Creator, and I want to implement an on screen timer that starts in the beginning of the game and decreases every second.
In the action list editor for OnStartCutscene (after I play a small cutscene) I set Variable Set Timer and made it -1 sec every second and the Max value is 300 (5 mins) while Min value is 0.
The question is how do I create a UI that will show this Timer at all times in the bottom right corner of the screen? I really would appreciate your assistance! Thank you!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Just an update:
I was able to create a Menu with a label that displays the variable I created that displays 300, but that is not linked to the Timer that I have. Is there a way to connect them together?
Update:
I found another thread with an answer from ChrisIceBox, and the answer was this:
Since this thread was posted, AC has a dedicated Timer feature. You can create a Timer from the top toolbar, under Adventure Creator -> Editors -> Timers Editor.
Create a new Timer, and check Link to Global Variable?. Create a Global Integer variable, setting its Default value to the default length of time (in seconds) and link it to the Timer.
Set the Timer's Value increases per tic property to -1, and set the Max value to the highest amount of time you want the timer to be.
At runtime, you can then use the Variable: Set timer Action to begin the Timer, which will reduce the Integer variable's value by 1 every second.
To have the game end when it reaches zero, assign an ActionList asset in the Timer's ActionList on update property. Set this list's When running property to Run In Background, and have it run a Variable: Check Action to check if the Integer variable's value is zero. If it is, have it run the Engine: End game Action to end or restart the game.
Thank you. Sometimes I realize that searching deeper is better than just asking on Forums, but anyways, whoever reads it have a great day.