<aside> 💡 In this tutorial, you’ll learn to create simple gameplay logic to your level.
</aside>
Our level is already playable as it is, but we can make the experience more in-depth by adding simple logic to it: “When this happens, then this happens.” With the available logic tools, you can create all kinds of gameplay: open a doorway when the player goes through a trigger zone, award the players with a “Nailed It!” end state when they reach a goal area, and so on. Gameplay logic is a topic that can get quite deep, so let’s keep it simple and stick to basics for now—we can have a more detailed look at things in a future tutorial. Let’s see what kind of logic we can add to our level!
To get started, you can open up the SX Toolbar and access the Triggers and Logic section. There you’ll find four buttons:
There are two ways to bring logic elements to the scene: via the Add Logic Object window, and via the project browser. For now, the project browser will suit our needs better, so let’s use that!
Press the List Logic Prefabs button in the Toolbox. In the folder that opens, you’ll see various logic prefabs from examples to premade groups, as well as game objects with logic inputs.
The basic structure of gameplay logic is this: Some specific condition is met, and this acts as a trigger for activating an event in the level -- we'll call this activated event a triggerable. Let’s talk about these for a little bit!