How do I get a nice approach to creating and aligning tiles? I presumably have a perfect 1x1 prefab, since that is what my mesh claims to be.

I’m looking for perfect tile origin coordinate offsets, e.g. (1.0, 1.0), (2.0, 1.0)? I would like to be able to use both grid snap and vertex snap interchangably, though I’ll resign to one or the other if I must. The tiles are box colliders, so they can’t have a gap that will cause problems with typical CharacterConroller and rigidbody solutions, though overlap may be permissible.

In my experiments, I always end up with an apparent drifting floating point precision error. So, a long row of grid snapped tiles diverge from vertex snapped tiles, which diverges from perfect coordinates. If I mix and match use of grid snap and vertex snap, I’ll get blocks that don’t align. Is there a way to keep blocks on the grid by using vertex snap?

Thanks!

Hello, it is done with general maths, if you want each tile to be one unit, you make a loop on X and Y so that every tile is in between on position 0.5, 1.5, 2.5… that is perfect precision it is as easy as that.

    var size= 20;
	
    for (var z = 0; z < size ; z++)

    for (var x = 0; x < size ; x++)
    {

instantiate(tile object, Vector3(x+.5,0,z+.5), Quaternion.identity);
}

So, I played with an editor script for object drag and drop that forced a grid snap posted here.

But, ultimately, I concluded that this was unnecessary for my purposes. I abandoned the vertex snap approach, which introduced an accumulating floating-point precision issue with my cubes. Instead, I’m using both Ctrl + axis drag on selections and Ctrl + plane drag (when I only want to restrict it two two axes). Now, all of my cubes stay on intended transform position multiples, but I can layout and manipulate fast with duplicate and drag.