Getting location of middle of my grid?

I made a grid (well, it’s just a plane with texture tiled 250x250 so I have 250x250 squares).

It works just as I need but I am having trouble snapping to middle of square.
Each square is 100x100 size.

I have a function called getCursorPosition (which as name suggests - gets cursor position in game space).

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).

So add 50? No? Also, there are some snapping nodes that may work for you.

150 didnt work

Are you multiplying by 150 or adding 50 to the end result?

Adding 50 to X and Y end result.

Set it to 100 to get the grid lines and then add 50. If you set it to 50 and add 50 you’ll just hit the lines again.

Image from Gyazo

Hi, it worked in a way.
There is slight mis-functionality, would you perhaps know approach I could take to solve it?

See in this video I made: Snap Issue | UE4 - YouTube

It appears to snap to nearest grid only when it’s +50 into next one, would it be possible to somehow snap into that square as soon as mouse enters it?

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:

Image from Gyazo

edit: or just move the grid…