Tile Events
Make one cell of a map do something: a door, stairs, a chest, a sign or a trap.
About 4 minutes
A tile event makes one cell of a Tilemap do something when the player reaches it: a door to another screen, stairs, a chest that opens once, a sign, a trap. It's the RPG Maker way of building a map: click a tile and give it things to do. Games only.
You don't need to place an object on the tile. The event belongs to the cell itself, whatever tile is painted there.
Making one
- Select the Tilemap in the Hierarchy.
- In the Scene, right-click the cell and choose New Tile Event…
- The Tile Event window opens for that cell. Add a page, set its trigger, then add actions.
Every cell with a tile event shows a small cyan dot in the Scene, so you can see them at a glance. Right-click the cell again for Edit Tile Event, or to copy, paste or clear it.
Next to the cell's position, size sets how many cells wide and tall the event covers. A two-wide doorway is 2 wide, so the player can walk in on either cell.
Pages
The tabs along the top of the window are pages. Click + page to add one. Each page is a complete version of what the cell does, with its own condition, trigger and actions.
When the player reaches the cell, the last page whose condition is true is the one that runs. That's how a cell changes over time: page 1 is the closed chest, page 2 is the opened chest, and page 2 takes over once its condition turns true.
Use ↑, ↓, Duplicate and Remove on the left to manage the selected page.
Settings
| Setting | What it does |
|---|---|
| self switch | Optional. Runs this page only when one of the cell's own switches (A to D) is on. Each cell has its own four, so a switch on one chest never affects another. They save automatically. |
| other condition | Optional. Runs this page only when a variable passes a check, like hasKey = 1. Use this for anything shared between cells or screens. A page uses a self switch or another condition, not both. |
| trigger | Player touch: runs when something steps onto the cell. Action button: runs when the player faces the cell and presses the interact button. |
| tag | Player touch only. What this cell is, for Collider tag filters. |
| reacts to | Player touch only. Only things with this tag set it off. Leave it blank for anything. |
| actions | What happens, top to bottom. Click + action and pick one. |
What a tile event can do
The actions are grouped in the picker:
- Variables: Add to a variable, Set a variable, Roll a random number.
- Lists: Add to list, Remove from list, Pick from list.
- Talk & cutscenes: Talk, Play a cutscene, Show an emote.
- Move & screens: Go to screen, Teleport the player, Save location, Go to saved location, Pause / allow location save on close.
- Sound: Play a sound.
- Player: Lock/unlock player input.
- Other: Send an event, Destroy what touched it, Turn what touched it on/off.
Example: a door to another screen
- On the door cell, make a tile event with one page, trigger Player touch.
- Add Go to screen and pick the screen.
- To land the player in the right spot, put a Spawn Point on the other screen and pick it in player arrives at. Add a transition like fade if you want one.
Want a door the player has to open on purpose? Use Action button instead, so it only fires when they face it and press interact.
Example: a chest that opens once
- Page 1: trigger Action button. Actions: Add to list (the item into the player's bag), Talk for a "You found a potion!" line, then Set a variable
cell.switchAto1(that's self switch A). - Page 2: self switch on, switch A. Trigger Action button. Actions: a Talk line saying "It's empty."
Once switch A is on, page 2 is the last true page, so the chest stays open, even after the game closes.
Use a tile event for things that are part of the map (doors, stairs, signs, traps). Use an Interactable object for things that have their own picture or move around, like an NPC. Use a Collider for things that react to any object touching them, not just the player.
Press the ? buttons in the Tile Event window for a quick reminder of all of this.