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. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    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:
    967
    Thanks! We will check this out!
     
    Ishimine likes this.
unityunity