With Unity 4.3, how should I import my map?

For my 2D hack and slash game I would like to import a map into Unity and set it as a background but I am very confused as to how to go at it. After that I’ll to add some collision lines using the background image. Should I be using “Sprite” or is there some other more effective way?

1 Answer

1

If you’re doing a 2d game, you should use sprite. It’s the most effective way.

For the collision, use the Collider 2D families:

  • Circle collider (CircleCollider2D) supporting a centroid and radius.
  • Box collider (BoxCollider2D) supporting a centroid and a size.
  • Polygon collider (PolygonCollider2D) supporting an arbitrary set of polygons. It can be initialized to the shape of a sprite by dragging the sprite onto the component.

You can also look a the 2D tutorial who offer good idea on how to work with the 2D feature:

Thanks alot for the answer. But does it matter if my sprite is huge? Like over 5k pixels.

It may affect the performance of the game. But it's easier to reduce resolution than increase.

I guess I could use some kind of tile spawning approach which would reduce the size of my maps and make it more effective. Alright thanks :D