I am developing a 2D tile-based top-down game. It is currently instantiating square objects with a sprite renderer to procedurally generate the map.

Each floor and wall is a 1-unit wide object.

I have two issues with that:

  • The memory usage is quite high and it is not efficient (generating maps that are more than 300x300 become really slow)
  • There are lights glitches when I have multiple lights in the scene. The borders of the squares become visible as seen in the picture:

enter image description here

  • Is it possible to combine all my static elements (floor and wall tiles) in a Mesh object, or another adequate object for that?
  • The floors items do not have colliders, as the walls have a box
    collider. Does it cause an issue?

for second and third question: try following this aproach . The post make reference to colliders but you can use it with tiles. Essentialy you can use big rectangular quads to enclose the same tiles like this:

enter image description here

Using larger quads reduce the tiled light effect.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.