Issues With Hexagonal Tilemaps

I’ve been following your tutorial on hexagonal grid movement and tilemaps https://www.youtube.com/watch?v=bcPqdCSGCls and I got everything set up fine. My tiles are the same sizes as the ones from the tutorial so the cell size for my grid is 1, 0.65, 1. Movement also works but the problem is that after moving enough in a certain direction (by increments of 0.5, 0.5), my character’s sprite becomes slightly out of line with the tilemap. I tried troubleshooting for a while and eventually made a list that stores the position of each tile and when I print it out, some of the Y positions end in 0.4 or 0.9 for example 3,-2.4, 0 which should not be a possible tile position and would cause the tile to not line up with the character. What’s causing this and how do I fix it?

Hi, would it be possible to share some screenshots of what you are experiencing? Thanks!

as you can see above the character (represented by an outline that matches the size of the top of a tile) is off the center of the tile and below, it lines up perfectly fine. I changed nothing between the two screenshots, the only difference is the position on the tilemap.

This is part of the log that shows the positions of the tiles in the tilemap and two of the positions have y coordinates ending in .9 and .4 rather than .5 and .0 which i believe is causing the misalignment on certain tiles.
7396229--903323--tile-positions.PNG

If character goes from position (0,0) to (1,0) for example it’s going to be much more reliable to translate to/from gridspace back to worldspace. The hexagonal tilemap uses the grid component, parent to the tilemap. You can translate from a gridspace position using tilemap.CellToWorld(). This worldspace position can then be assigned to your character.

Also make sure there’s nothing weird on the transform of the grid/tilemap that could be producing unexpected results. There are more methods on the grid component itself which allows a bit more versatility so long as your tilemap isn’t off-center.

I did end up solving the problem, the grid cell size detailed in the tutorial was incorrect and I fixed it after downloading the sample project.