Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

[FIXED] How to use the new Tilemap system with a public gameobject?

Discussion in '2017.2 Beta' started by iKlikla, Oct 8, 2017.

  1. iKlikla

    iKlikla

    Joined:
    Jul 31, 2016
    Posts:
    3
    Hello Friends, I was very excited when I heard about the new tilemap system.

    I am working on a 2d topdown game with a level editor, for this I now want to utilize the new tilemap system.
    I have already looked through the documentation and the API reference but couldn't find any information about my following construct.

    I have a Controller Object that holds every selectable game item in it's category, this Object is used for the UI and also for the placement system. I want to place my tiles like this:

    tilemap.SetTile(positionCursor, selectedTile);

    Easy enough, I imported UnityEngine.Tilemaps and added a public variable for both the Tilemap and the Tile. I dragged the Tilemap into it's variable but now I have a problem. I have a RuleTile Asset inside of my Tile Palette and want to reference this now. How would I do that? I tried to find the location Unity saves the tiles but I couldn't find anything. When I try to select a Tile from the UnityUI the list is empty in both tabs.
     
  2. iKlikla

    iKlikla

    Joined:
    Jul 31, 2016
    Posts:
    3
    Fixed: I have to use "public TileBase" instead of "public Tile"