In this tutorial, you will learn how to use the “boolean” type variable. In Speedernet Sphere, the boolean variable uses two values: true or false. Scenaristically, this variable is used to check if a condition is met to trigger one or more actions.
In order to see how to use the boolean variable, we will perform the scenario below:
“In the experiment, we have a hidden key for the user to find. This discovery allows you to unlock a door. Having become clickable, it gives access to the next scene.”
Before you begin, click to see the final rendering of this example.
Note that you can find these items in the Speedernet Sphere online library.
Once the elements are in place, here are the steps to follow:
- Add a boolean variable
- Define the integration needed to change the value
- Create the interaction after changing the variable
Step 1: Add a boolean variable
At the bottom of the elements column, open the variables window (see below).
Click on “add boolean”, then, click on the cogwheel (gear) icon (see below).
The next window will allow you to edit the variable (see below).
You can optionally rename the variable to find it more easily in the “Conditional” window. In our scenario, we called it “Ouverture porte”. Then, choose its default value: “false”. Finally, click on “Confirm”.
Step 2: Define the integration needed to change the value
Position the key to find in the background (image element). Make it invisible by default, then add a trigger that will be used to discover it. This will be interactive and invisible. When clicking on this trigger, the key will appear and the “Ouverture porte” variable will change value, from “False” to “True” (see below).
Step 3: Create the interaction after changing the variable
When the variable becomes true, there are consequences: access to the door opening becomes possible. The door zone becomes clickable and allows you to change the scene (see below).
This tutorial presents one use case of the boolean variable. You can use this variable for other types of scenarios. Here are some examples :
- make elements appear
- authorize access, unlock a padlock, etc.
- create combinations with several boolean variables (all false, true, etc.)
- visit an area in a 3D scene
- answer a survey
Share with us the scenarios in which you will use this type of variable and give us your feedback!
See you soon for the next tutorial!
I also invite you to consult the following tutorials: