Td grid placement i need help!

Ok so i need a way to place the towers using grid system but the mouse only tracks pixels not grid
And i thought i could use a proximity to place it ton the closest grid block… Any suggestions?

1 Like

I think there is an expression that is able to convert pixels to the nearest grid, but idk the formula, maybe @JR01 might know or has a better idea.

1 Like

mk thank you

1 Like


this is the formula im pretty sure but for some reason using grid wont show the placement object
image

the placement object is supposed to follow the mouse

Is it set to a higher layer than everything? If not, you probably wanna set that layer up.

1 Like

Use the “Set” and “Get” inputs for the number block

2 Likes

ill try that

what do you mean by that?

Ok know what forget what i said i want the placement to move smoothly by pixel not grid what i want is for when you place the tower it gets placed grid style make sense?
so i was thinking to use a proximity to find the closest object to your mouse and place it there the problem lies when you place the tower, the tower is not centered like a grid

example of bad:image

example of what i want/good:image

If you get the Grid movement, the spawn will be centered because the target would be centered.
You just needed to use “Set” and “Get” like I mentioned before:

image

Make sure both number blocks are set to “Round down” and the position block is set to “Grid”

2 Likes

it worked thinks my only problem was not rounding down! and putting the expressions on get…
thx @JR01

1 Like