Create a new scene and use TileMapLayer as the root node.
In the Inspector locate the Tile Set property
Replace <Empty> with New TileSet
Use the Terrain.png tileset image located in the Terrain folder.
At the bottom of the screen
Drag and Drop the Terrrain.png image into the Tiles window.
Accept the offer to recreate the Tile Atlas
Most of our tiles will be solid but, those in the top right corner will be special
They will allow the player to pass through them.
To achieve this we will use two different physics layers on the TileSet.
Expand the TileSet property
Under Physics Layer add TWO new Elements
The TileSet now has TWO different physics layers
Each layer will interact with the player differently.
Tiles on Collision Layer 2 will be solid ground tiles and we will rename the layer to reflect that.
Tiles on Collision Layer 3 will be pass_through tiles and we will rename the layer to reflect that.
The player will occupy Layer 1 and we will rename the layer to reflect that.
Click on the numbers to turn layers on and off as shown in the screenshot to the left.
Collision Layer 2 is ON and LOOKING for collision objects on
Collision Layer 3 is ON and LOOKING for collision objects on
Rename the layers as shown by clicking on the 3 dots and then Edit Layer Names
These are our solid ground tiles
Here we can adjust the collision polygon for each individual tile!
For our purposes we will simply leave the polygon as a square
and paint every tile except for our pass_through tiles as shown.
(Paint by clicking on each tile.)
Switch to Physics Layer 1
Ensure that One Way is ticked
for each of the pass_through tiles.
Adjust the collision polygon
Paint the pass_through tiles as shown.
One Way Collision means that the player can collide with the tile from above
This allows the player to jump UP onto the tile from below with no additional code.