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
- Above the start function, create a new variable called
shouldChestMoveand set it equal to
- 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 to
Right now this won’t change any of the chest’s behavior. For that, we need an if statement.