I’m making a hex grid, in which every hex is a separate mesh. The hexes have pivot set at the center of their top, so transform.position returns the coordinates of hex top, not inside the mesh. Hexes are going to be prefabs. Hex radius is 0.5 meter and pointy ends lay along the Z axis.
The first thing is I’d like the code to work in the Scene view, not only in Game mode. The script needs to do the following:
1. The hex is snapped to the grid in X and Z axis, in Y axis it can be moved only by 0.1 meter.
2. The first hex is automatically placed at 0,0,0.
3. Placing a hex automatically creates a Waypoint at its pivot point.
4. After placing a Waypoint the script checks whether there are any neighbours and connects to them if they exist.
I spent 2 days trying to code that but something is wrong all the time, I think posting my code(s) is purposeless.
This topic was modified 1 month, 1 week ago by McRoastbeef.