Preparing the Spawn Trigger

Similarly to the creation of our checkpoint and pit trigger volumes, we’ll be creating a Slime-activating trigger volume:

1. Create an empty GameObject and name it “triggerSpawn.”

2. Select the yellow circle icon so that it stands out from our checkpoint and pit trigger volumes.

3. Click Add Component and choose Physics 2D > Box Collider 2D.

4. Click the “Is Trigger” property to set it to true.

5. Place the triggerSpawn GameObject far enough back that the player will hit it shortly before they would see the stairs on screen.

6. Adjust the size and position of the Box Collider 2D so that it’s tall enough to be unavoidable, as we did with our checkpoint triggers. See Figure 9.11 for an example.

Figure 9.11 Placement ...

Get Learning 2D Game Development with Unity®: A Hands-On Guide to Game Creation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.