Advertisement

Unity colliders for very large maps

Started by January 11, 2019 04:12 PM
4 comments, last by Sir_Pep 6 years, 1 month ago

Hello,

Quick question for anyone willing to provide some advice: I'm building a rather big, 2D, top-down, map for my game in Unity. Making colliders for all the walls in the map is a drag and a half. I know I can add 1 collider per tile and then duplicate said tile but the map 250x250 tiles and it is going to take forever if I do it that way. So my Idea was to create empty game objects and add colliders to those objects. It seems to work okay and it's not so time consuming but I can foresee that in the end I'll end up with 50+ game objects and 10+ colliders in each one (tl;dr it's gonna be a mess). Does anyone know any better ways of doing this? I'm very new to Unity and I'm not sure if I'm doing it right or effectively. Thanks in advance.

It's not clear from your description, but are you using Prefabs for your tiles?

My process for building a large scene out of small objects is usually procedurally programmatic.  I build each type of object as a prefab, then using code I place them where they need to go.

If you are wanting to do it all by hand though, then I would recommend creating 1 of each type of tile as a prefab and then just placing prefabs filled with objects and colliders on your grid.

Also, I'm not too familiar with the 2D toolsets in Unity these days, they have advanced much over the last year or two..  But perhaps the tilemapper would be of assistance here?

https://unity3d.com/learn/tutorials/topics/2d-game-creation/intro-2d-world-building-w-tilemap

Advertisement

Here's an example for what you probably want to do using Tiled.

https://www.youtube.com/watch?v=U2DU7sH1GxI&index=2&list=PL_4rJ_acBNMH3SExL3yIOzaqj5IP5CJLC

Much easier and very simple

 

22 hours ago, SIr Pep said:

Here's an example for what you probably want to do using Tiled.

https://www.youtube.com/watch?v=U2DU7sH1GxI&index=2&list=PL_4rJ_acBNMH3SExL3yIOzaqj5IP5CJLC

Much easier and very simple

Saw the video you linked. I think (and hope) it's gonna work so I'll give it a shot. Thanks!

That link is a whole series, so you'll probably be able to get other stuff out of it too.
Your Welcome :)

This topic is closed to new replies.

Advertisement