-1

I am currently building a hexagonal grid system in unity, with hexagons whose dimension is a little different than regular one. It's pointy-top, but its height and width is all 1, instead of 1 and sqrt(3), to match unity tilemap size and I prefer the way it looks to regular one. And that's where my problem starts..

I want to write a method in which I can translate Vector3 world position to Hex Grid position (Cube Coordinate), but since it's dimension is tilted, regular methods don't work.

How can I get the Hex Grid position with world Position? any help please?

I tried pretty much all the algorithms in redblobgames.com but none of it seems working.

1 Answer 1

1

There is a nice Unity tutorial series about the hexagon maps: https://catlikecoding.com/unity/tutorials/hex-map/part-1/

All of the math and stuff like that is nicely explained.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.