This function also calls another function - getNearestSnap (which should ideally get nearest square center).
(My grid points are just based on coordinates in world space, it doesn’t check for grid lines or anything as it’s just texture).
The issue is in getNearestSnap.
If I change values to 100 - it works okay (but it ends up on grid lines rather than in middle of each square).
Since I changed it to 50 - it snaps to both - grid lines, grid intersections and square centers.
I need to limit it to snap to square centers only (so get nearest square center pos).
I’d just make the grid divisible by 2 (so 24x24) instead, so you never need to worry about offsets since you’ll be applying them to everything further down the line. One less thing to worry about: