Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Bug Tilemap Gizmo displayed at wrong height (only on Hexagonal Cell Layout)

Discussion in '2D' started by Ishimine, Aug 2, 2022.

  1. Ishimine

    Ishimine

    Joined:
    Mar 15, 2015
    Posts:
    4
    The Gizmo of the tile that is being hover in the tilemap grid, is displayed at the wrong Height, when Z Position is different from 0 (Only in Hexagonal Tilemap).
    It works fine with Rectangular and Isometric tilemaps, but it the height, in Hexagonal tilemap.
    The error gets bigger the bigger the absolute value of ZPosition gets (if ZPosition is 1, it will miss by 1 Unit, if its 2 will miss by 2, and so on).

    (Gizmo should be on top of the tile)
    First one is OK, second and third are wrong

    0.png 1.png 3.png

    Same Tilemap, but this time with Isometric Cell Layout

    isometric.png
     
    Last edited: Aug 2, 2022
  2. Ishimine

    Ishimine

    Joined:
    Mar 15, 2015
    Posts:
    4
    The error seems to be in the class GridEditorUtility.cs of the Tilemap Package. in the function "DrawSelectedHexGridArea()", line 251, when the "cellOffset" is calculated, the Z value should be 0, but instead is assigned from "area.zMin".

    Original Code and Result
    original.png

    "Fixed" code and Result
    Fixed.png
     
  3. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,033
    Thanks! We will check this out!
     
    Ishimine likes this.