In this tutorial, you will discover how to use the “Timer” variable.
This variable allows you to create a countdown timer for timed interactions. You could use it in a training course or an escape game, for example:
- To encourage the user to perform actions or finish a quiz within a given time frame.
- To trigger other actions or display elements at a specific moment.
In this tutorial, we will perform the following scenario:
“In this experience, learners will find themselves in the subway. A welcome message appears on the screen. The goal is to find all possible exits from the subway before the timer stops. On click on “Close” the message, a 60-second countdown starts. At the end of the timer, if the learner hasn’t found all the exits, a message “Too bad, you were almost there!” appears, otherwise the learner is congratulated for finding all the exits.
Steps
Once the elements are placed, here are the steps to follow:
- Create a Time variable
- Create the required conditionals to change the value of the variable
- Define the right conditional consequences that must trigger after the variable switch
- Display the variable
Step 1: Add a Time variable
In the left panel, open the “Variable Manager” by clicking the following icon .
In the “Variable Manager”, you can add and configure all your variables.
Now:
- Click “Add a variable”
- Rename the variable
- Choose the “Timer” type of variable
- Define the default value for your variable. In our example, the value is “1 minute”.
Step 2: Create conditionals to change the variable
Access the “Scenario Mode” and add a conditional for each element related to the time variable.
Remember that in our example, we have an image that will change its aspect in 30 seconds.
Step 3: Define the consequence when the variable changes
You must define the expected consequence(s) after the variable change.
Create a conditional for each expected consequence according to the value of the variable:
For this example of scenario, here are our conditionals:
Step 4: Display the Variable
For this last step, we will now see how to display your "Timer" variable in the project.
Example: For an escape game, you will have a real display with the seconds that are running out to know how much time you have left.
First, you will need to add a new text element to your project.
Previously you had to create your "Timer" variable. You can now rename this variable to Timer.
Once this is done, we will fill our text with the same name as our variable, "Timer". This text should be between two braces and not include any spaces --> {Timer}.
You can of course customize the background and color of your text.
For the display to work properly, you will need to have a conditional linked to this variable.
Example: In my scene, the variable "Timer" is launched when I click the image “Close” the welcoming message. At the same time, the welcoming message and the “Close” button become invisible.
Note that our variable will remain as text, but if we launch our project "play" our variable will be transformed into a real timer. Here is the result you will get. The seconds will elapse as if a real timer were present.
Share with us the scenarios you would use this type of variable in and let us know what you think! See you soon in our next tutorial.
You can also have a look at the other variables:
Comments
0 comments
Please sign in to leave a comment.