q auick try:

tile.x = hit.x- (hit.x% grid_size) + grid_size/2;
tile.y = hit.y- (hit.y% grid_size) - grid_size/2;

(only this 2 lines in if changed)


3333333333