Generate a map with tiles

Hello everyone,

Actually :

  • I have an huge 2D array.
  • This array is filled with value beetween 0 and 1.
  • I use this array to create a map.
  • I use a texture to display my map, each pixels get a color according to the 2d array.

It works, but now i want to use sprite instead of pixels.

My question is what is the best way to generate a map using sprites based on a 2d array?

The final aim of this project is to create a really simple RPG and i will need to interact with the map (for character movement for exemple)

Can you help me?

Did you know that Unity now has something called a TileMap? You can get it from the package manager.

It sounds like it would be perfect for what you’re talking about, plus it gives you even more than “just sprites.”

I recommend checking out a tutorial or three on it, then making a blank project and fiddling with it until you kinda wrap your mind around it… it’s pretty slick.

https://www.youtube.com/watch?v=fmNtibNWPhc

1 Like

Ok, it seems better than using prefabs.