Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Need help with few issues (tile mapping, etc)

Discussion in '2D' started by Nicholas1010, Jul 15, 2016.

  1. Nicholas1010

    Nicholas1010

    Joined:
    Aug 2, 2014
    Posts:
    20
    Hello. Some time ago I was making a little top-down view 2D game. and I had a lot of issues with getting map function properly. And I made this thread to maybe get a few tips from people who have experience with this.

    What I did was: I made tile prefabs, made a "map" empty gameobject so my hierarchy screen would not get spammed up by all the tiles I will place manually, and then placed and adjusted every single tile manually, then later I ran into some problems and now I am re-working everything, but problem is, I have no idea what to do, to at least slightly fix the problem.

    So whats best and free way to work with tilemaps on Unity 5.4 beta? Any suggestions to improve my situation a little? I am open to anything.
     
  2. Hyblademin

    Hyblademin

    Joined:
    Oct 14, 2013
    Posts:
    725
    @Nicholas1010

    Off the top of my head, you can at least have your tiles snap to the nearest tile-sized grid space by attaching an edit-time-executable script to the tile prefab(s) that rounds the transform.position x- and y-values.

    If you haven't used editor scripts, I think you should start playing around with them. They'll get useful for automating level design tasks, among other things. For example, you could write a script to populate a defined area with a configurable floor tile. This way, you could quickly fill an area with the most common tile, then work to replace specific ones with detail tiles, like trees, walls, etc. You could also write a script to destroy tiles if another is placed on top of it, so that you don't have to manually delete tiles you want to change.

    Beyond that, I have no idea which problems you're having (because you haven't told us), so I can't help. What kinds of issues are you seeing?
     
    Last edited: Jul 19, 2016
  3. Nicholas1010

    Nicholas1010

    Joined:
    Aug 2, 2014
    Posts:
    20
    Oh, thank you I will take a look.

    I have made some short-term workarounds but it won't last in the end probably so I'll use that when I'll run into another problem :)