- Home /
Hexagonal grid with 120 degree angles
How to set grid cell size for regular hexagons (I am using Unity Tilemap and Grid components)? I mean hexagon with 120 degree angles (regular hexagon). If I have cell height = 1 unit then width should be = sqrt(3) * width / 2 (for point top hexagon). I can't set right cell width in inspector because of sqrt. Even if I set it manually, but it is not elegant solution. If I rotate the grid for 30 degrees, I want to get the same hexagon, but I get crooked one (with default cell size).
Answer by Nikita-Drugoy · Oct 25, 2020 at 10:32 AM
UnityEngine.Grid component doesn't provide functionality I need. So I made my own implementation of hexagonal grid using this guide: https://www.redblobgames.com/grids/hexagons/
Your answer
Follow this Question
Related Questions
Change hex tilemap to use axial coordinates? 0 Answers
Low frame rates when using custom 2d tilemap 0 Answers
How to use the same tilemaps among multiple scenes (e.g. making it a prefab)? 0 Answers
How to check if a grid unit position has a tile from the Tile Palette placed on it? 1 Answer
Grid and or Tile System 0 Answers