Search Unity

Question Problems with Tilemaps - Assets stick to grid!

Discussion in '2D' started by Housten, Dec 27, 2022.

  1. Housten

    Housten

    Joined:
    Dec 27, 2022
    Posts:
    3
    Hello guys!

    I want to ask if someone knows how to solve my problem. While using my tilepalette its not possible to place the assets free without them sticking to the grid. If tried various ways even from the unity wiki itself. If someone has an idea please let me know!

    Greetings

    Housten
     
    weskrr likes this.
  2. AngryProgrammer

    AngryProgrammer

    Joined:
    Jun 4, 2019
    Posts:
    490
    You cannot use tile assets without Grid and Tilemap.

    https://docs.unity3d.com/Manual/class-Tilemap.html
     
    Last edited: Dec 27, 2022
  3. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,513
    You could freely place a GameObject with a SpriteRenderer. That's not constrained to the grid.

    Tilemaps kind of are just a grid at the end of the day. You can however vary where your tile appears within the grid. If you select the arrow...
    d - Copy.png

    Then click on a tile to adjust its sub-cell position. But an important caveat! That tile can't force Lock Transform. The below example does "Lock" the transform, so it can't be modified.
    d - Copy - Copy.png
     
    Housten and weskrr like this.
  4. Housten

    Housten

    Joined:
    Dec 27, 2022
    Posts:
    3
    At first: Thank you very much! That's exactly what I needed. I was splitting my assets everytime which made much more work. Now I can simply move them thats great.

    I dont know if it makes sense asking that here again but maybe u can help me out one more time.

    upload_2022-12-27_14-20-4.png

    But is it wise, doing it this way? Like is there anything to notice while using this method for later on? I mean when I need to do the borders, collsion and stuff like that. Im currently working on three different layers:

    upload_2022-12-27_14-21-54.png

    Ive seen ppl working on just two layers mostly (Back- and Foreground) but when I want to place the bed and the
    bedside table in the same Grid, it simply replaces it. So ive added a Midground Layer also which I think dont makes that much sense. But that was the way ive simply solved my problem for now.

    Also ive seen, that my sprites dont work properly when im going into the game.

    Thats how it should looks:

    upload_2022-12-27_14-25-0.png

    And thats when im going into the game:

    upload_2022-12-27_14-25-36.png

    I guess you can see the difference. For referenz ill put the settings also down below:

    upload_2022-12-27_14-29-43.png

    Again thanks for you time and Ill hope you can help me out once more! :)
     
  5. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,513
    1. All of your tilemaps can be children to the same Grid so long as that Grid's settings don't vary.

    2. Splitting up over several tilemaps (fore/back) / (fore/mid/back) is very normal. It won't interfere with collision because collision stuff is separate. If you use colliders, your colliders register into the Physics2D system the same whether their source is a Collider2D or TilemapCollider2D, from one object or from many.

    In this pic, however, I'm not quite sure what exactly you're referring to or how what's shown is split onto different tilemaps. Is the background = floor, midground = drawer & bed, and mushroom = foreground? That's probably fine.

    3. You may need to double check you're following a Pixel Perfect guide completely. There are many "gotchas" to Pixel Perfect that can cause it to not work quite right. Finding a recent YouTube tutorial might also help.
    https://docs.unity3d.com/Packages/com.unity.2d.pixel-perfect@1.0/manual/index.html
    https://docs.unity3d.com/Manual/com.unity.2d.pixel-perfect.html
     
    weskrr likes this.