How to create tiles
Creating your building blocks.
Creating a Tile
is just as easy as creating a new Graph
Just like you did when you created a Graph, access the Assets menu in Unity, either by right clicking in your Project window, or by clicking the ‘Assets’ button in the Unity toolbar.
In the Assets menu, select Create ➔ Tile
to create a basic Tile, or select Create ➔ 2D ➔ Tiles
to see a list of Tiles with special behaviours. After selecting which type of Tile you want, a Tile object should appear in the current folder of your Project window.
TerraTiler2D makes use of Unity's tilemap system
to create worlds. This means that the Tile
classes are not provided by TerraTiler2D, but originate from the UnityEngine.Tilemaps namespace and the 2D Tilemap Extras dependency, which should both be included with your installation of TerraTiler2D.
Below is a brief description of each type of Tile, but for more information you should check out their documentation
or GitHub repository
|Tile: A basic tile that shows a Texture and has the option to detect collisions.
|GameObjectTile: A tile that spawns a GameObject prefab, and then disables itself.
|RandomTile: Random Tiles are tiles which pseudo-randomly pick a sprite from a given list of sprites.
|AnimatedTile: Animated Tiles are tiles which run through and display a list of sprites in sequence.
|RuleTile: Generic visual tile for creating different tilesets like terrain, pipeline, random or animated tiles.
|Isometric Rule Tile: A Rule Tile for use with Isometric Grids.
|Hexagonal Rule Tile: A Rule Tile for use with Hexagonal Grids. Enable Flat Top for Flat Top Hexagonal Grids and disable for Pointed Top Hexagonal Grids.
|Rule Override Tile: Rule Override Tiles are Tiles which can override a subset of Rules for a given Rule Tile to provide specialised behaviour while keeping most of the Rules originally set in the Rule Tile.
After creating your Tiles, you will want to use them in your graphs. To do so, you can simply drag them into any field of type TileBase
, such as a Tile property, or the Tile port on a TilePlacer (Noisemap) node
Do keep in mind that if you reference a Tile in one of your graphs, whether it is as a property or in a port field
, you should place that Tile object in a Resources folder at Resources ➔ TerraTiler2D ➔ Graph Resources
. This is required for TerraTiler2D to find the Tile object in a build of your project.