Advertisement Jump to content
NickPnevmati

Unity colliders for very large maps

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!