Create Grid and Snap Rigidbodies to Grid

I’m not much of a programmer and I’m having a difficult time with the following:

  1. Setting up a grid system
  2. Snapping objects with the dragrigidbody script to the grid once the mouse button is released.

Any examples or pointers would be much appreciated!

I don’t know about that script, but you can probably store all your grids points and once you release the mouse find the closest (and use trees or regions, but if you’re not much of a programmer, that might be a stretch).

Oooooor, a probably more clever way would be to have gameObjects on each of your gridPoints with a collider, so you can use Physics.OverlapSphere() and then narrow down your list of candidate for the closest.

As to build the grid itself, you’ll need some Vector3, two loops “for” and if you want a visual, LineRenderer.

Have fun !