1
\$\begingroup\$

In unity when using the in built tale palette to place tiles into the scene, I have come across a small problem. Im using an isometric tile-map and whenever i go to place a block, I end up placing a tile right above another tile. So if i was to for example place a tile at z=0, if i wanted to place a block above that I would have to have my mouse hover over the bottom of that tile but instead my mouse detects the top region of the previous tile which places the new tile farther and not just above. Only way I know to place that block is, go to and empty space outside and from a specific point you hover ur mouse under the block then increase the z with subtract. This is horrible for building a proper map. Is there a way to restrict it so that i can only click on the bottom of the tile? (i'm attaching screenshots if it didn’t make sense)

1.Can place tile above old tile when hovering over the bottom of the first tile enter image description here

2.But when hovering exactly over the first tile, it places new tile at a different level enter image description here

Edit 1:

enter image description here

Edit 2: https://youtu.be/kKJ30A9u5ts As you can see I for example wanted to place a tile above an old tile but since its hovering overing the top of the tile, it places the tile in a weird spot and also more of what I mean https://youtu.be/VNF0kYoB4YQ I want to place a tile above the one I am hovering on at z=2

\$\endgroup\$
8
  • 1
    \$\begingroup\$ Can you show us the configuration of your Tilemap component? This can be influenced by the "Tile Anchor" property there. Another thing to check is the location of the pivot of your tile sprites, visible/editable in the Sprite Editor window. \$\endgroup\$
    – DMGregory
    May 12 at 12:46
  • 1
    \$\begingroup\$ This looks as expected. The white box identifies where z=0 is, and the blue box identifies where the actual sprite is. \$\endgroup\$
    – Mangata
    May 12 at 12:58
  • \$\begingroup\$ @DMGregory My problem is with the how unity handles placement of the tiles. Basically I have no problem with placing from negative Z to the positive but since I have to design it very specifically I might have to for example make a pillar from the centre. When I go to the centre directly I hover over the top of the tile which places the new tile slightly farther, where as if I came hovering from the bottom of the tile I would be placing it exactly above. I also attached my Tilemap component screenshot in the og post. The one attached to the grid and within the tile palette are the same. \$\endgroup\$
    – Kami19
    May 12 at 17:59
  • 1
    \$\begingroup\$ @Kami19 When you increase z, you are actually still editing at the z=0 level, and when you add a tile with the mouse, you click on the z=0 grid. This is how it works. \$\endgroup\$
    – Mangata
    May 12 at 18:29
  • 1
    \$\begingroup\$ @Kami19 Thank you for the video. I do understand what you're talking about. The problem is that not all blocks are standard cubes. So detection of "click on the top of a tile" is impossible. But the plane with z=0 is standard. So unity makes your clicks in this plane so you can never click on the top of a tile, but on the z=0 plane. The white box is drawn above the tile just to make it easier for you to see where it is. It is actually drawn on top of all tiles. This can be visually confusing. \$\endgroup\$
    – Mangata
    May 13 at 11:10

1 Answer 1

1
\$\begingroup\$

"Thank you for the video. I do understand what you're talking about. The problem is that not all blocks are standard cubes. So detection of "click on the top of a tile" is impossible. But the plane with z=0 is standard. So unity makes your clicks in this plane so you can never click on the top of a tile, but on the z=0 plane. The white box is drawn above the tile just to make it easier for you to see where it is. It is actually drawn on top of all tiles. This can be visually confusing." – Mangata

\$\endgroup\$
2
  • 1
    \$\begingroup\$ This answer is just a copy/paste of another user's comment. Mind to write a more comprehensive answer on your own? It's okay to build upon that comment, as long as you describe the actual steps that solved your problem. \$\endgroup\$
    – liggiorgio
    May 14 at 11:34
  • \$\begingroup\$ @liggiorgio oh I didn’t think about that. My problem still hasn’t been technically solved cause I wanted to be able to hover over the bottom of the tile as it makes designing levels much simpler. As stated by Mangata above "The problem is that not all blocks are standard cubes. So detection of "click on the top of a tile" is impossible." So this was the answer. \$\endgroup\$
    – Kami19
    May 15 at 14:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .