Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
3
Question by TymmieX · Jun 11, 2019 at 12:01 PM · editortexture2dgrid

Hexagonal Tilemap

Hi, I'm trying to use the Hexagonal Point Top Tilemap for my 2d Hexagon game. So now the problem is that the Grid of the Tilemap has a different size than the Tiles and I don't understand why. So the size of the Tilemap Palette fits perfectly to my Tiles, but like i said the size of the grid is different. The Palette grid and the Tilemap Grid in the Hierarchy even have the same size. And no its not about the size of the Tiles that don't fit inside of a Hex grid, its about the the strange side lenght. I hope you know what I mean :D

Images: Screenshot 1: alt text Screenshot 2: alt text

screenshot-4.png (275.0 kB)
screenshot-5.png (257.6 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
3

Answer by Bluetooth4269 · Feb 17, 2020 at 02:57 PM

I've been messing around with this all day and have discovered a few things which I'll share, in case anyone else is looking for the answer to this question.

1) If you look at the Grid in the image above, you'll see that the sides of the hexagons are not even. This is because an even Hexagon is NOT height=1, width=1. You can fix this by going online, looking for a hexagon calculator and adjusting the cell size of the Grid in the Inspector accordingly. In case you're too lazy too look for it yourself, the width to height ratio on a flat-top hexagon is roughly 1 to 0.866 (reverse that for point-top). Or 1.155 to 1, whichever you prefer.

2) If your tiles are the right height-to-width ratio but the wrong size in the Tile Palette, you need to recreate the Tile from your png sprite and change the "Pixels per Unit" setting to be exactly the same as the height and width of your png. You should ensure that the height and width of your original sprite (the .png file) are identical (100x100 for example), as this will make all later adjustments in the Palette and Grid much easier. By this I do NOT mean you should squeeze or widen your hexagon in the png to match the edges. There should be empty space on the right and left or top and bottom of your png file.

3) If for some reason you can't recreate the Tile from png, you can also experiment with the scale in the Tile Palette by choosing the "Select" tool in the Palette (the mouse), clicking on your sprite in the Palette and adjusting the scale in the inspector. This is more annoying to work with though, as the Palette likes to reset the scale to 1 whenever you hit the "Paint" tool and click on your sprite.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image EAnderson · Mar 21, 2021 at 04:09 PM 0
Share

Thank you for this, it's obvious once you know why!

This was fixed for me by adjusting the height and width of the grid to use the "correct" ratio between the height and width of a hexagon.

However, this meant that all my sprites were now the wrong size as they had assumed equal heights and widths. This was easily fixed by bulk resizing my sprites with Windows Power Toys:

https://docs.microsoft.com/en-us/windows/powertoys/install https://github.com/microsoft/PowerToys/releases/

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

219 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How Do I Remove This Grid And Blue Dots That Showed Up? 0 Answers

ProBuilder Element Snap to Grid (Unity 2020.1.2f1) 0 Answers

Preview Window grid thickness and camera behavior 0 Answers

¿Como puedo hacer un Grid como Editor visible al jugar solo con ciertas medidas en 2D? (Como Geometry Dash) 0 Answers

Modular geometry not snapping properly once rotated 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges