As you know tilemap is a moving surface when your game character moves. We got acquainted with this concept in Lesson 2 Already. In this article, I will guide you to familiarize yourself with Autotile. The Autotile function helps us to automatically create tilemaps for the game without having to set it manually. Let’s just get started.
Join the channel Telegram of the AnonyViet 👉 Link 👈 |
We can summarize it as follows:
1. Select TileMap
2. Open TileSet from inspector
3. Expand the Child you want to use as autotile with autotile
a) You should create a TileSet with a single Sprite that holds the entire sprite page, instead of creating a separate Sprite node for each tile.
4. In the expanded view, check the “Autotile” box.
5. In the output box (at the bottom of the editor) you will see several tabs, one of which is called Autotiles. Select that tab to enter Auto view.
6. Now you will see several tabs: Icon, Bitmask, Collision, Occlusion, Navigation and Priority
You can see detailed instructions below:
How to create AUTOTILE
Initially create tileset or you can also use the same tileset, tileset allows you to add more pictures but here I create a new project so I will refresh
You click Autotile and then turn on the one in the picture
Then close it with the photo
Next in the Selected File
Tile Mode : AUTO_TILE
AutoTile bitmask : 3×3(minimal)
Next, you choose Bitmask
And fill in the middle parts with red, don’t paint the outside but use it as a surface for the player to stand on
Like this:
Or like this:
And next is set of Collision give it more
Done set
And just go out of the set when drawing a tilemap it will automatically create for you
So you have saved some manual time not having to create the moving surface by hand. The Autotile feature automatically helps you perform repetitive mounting operations.