So far we have made a variable that is the number type, but there are actually many other types that we can use. Boolean is a long name for a simple type of variable that can only be either true
or false
.
- Above the start function, create a new variable called
shouldChestMove
and set it equal tofalse
. - Save your script, and notice how Should Chest Move appears as a checkbox in the Entity panel, right under Amount To Move Up.
- When the box is checked, that is the same as setting the variable to
true
, and unchecked is the same as setting it tofalse
.
Right now this won’t change any of the chest’s behavior. For that, we need an if statement.