How To Snap to a Grid



This is an updated version of an older topic by me if it seems familiar. (all old topics were deleted)

Have you wanted to make things snap to a grid? It's simple

Just use the following code in an object to do so

Now this puts them on a grid of squares width 100, if you wanted to make the squares bigger or smaller, you would change all the 100's to a different width.
For example, changing all 100's to 50 would make the squares half the width and make the grid squares smaller.

This is in the open-source code so you can use this freely without credit if you want.

Hopscotch Academy - Always accepting new students and teachers!

Nice and simple tutorial! Have you thought of doing this but more like the Hopscotch grid? (meaning you can move the object freely)


Cool tutorial! This is really helpful, great topic :slight_smile:


I tried it, but the square just disappeared.


I haven't thought of that, but it'll probably take some more code with check once if's and such


Wow, that's really cool! Thanks for making a tutorial about it


How can you snap this drill to do that.


I'm sorry, but I don't exactly understand what you mean. Could you explain some more?


thanks for your snap grid