Hello Guest

Author Topic: Way to Create a Blank Tile Map and then fill it with tiles of a specified type?  (Read 3230 times)

robutmike

  • Newbie
  • *
  • Posts: 10
    • View Profile
Hello,

I am trying to instantiate a blank tilemap clone into the scene, then fill it with tiles of a specific type. When I tried this before, it worked, but the tilemap prefab was actually edited permanently instead of creating a clone. So each time I generated a map, the map contained the tiles from the old map, as well as the new (with new tiles overlapping old).

Can someone explain how to do this properly? Should I not be using a tilemap except for when drawing in the editor?

Thanks,
RM

Edit: I am a fool. I was not instantiating a new tilemap. Problem solved!
« Last Edit: December 11, 2013, 06:22:39 pm by robutmike »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
The tile map wasn't designed for runtime creation - it requires some data scripts which can't be created properly at runtime, but prefabs work perfectly fine. As you've found this works fine if you instantiate the prefab before using it.

You can make the tile map size as big as you like, the overhead is very miminal for an empty tile map.