Block snapped to grip in game

So For my creative game I need a box that spawn in the blocks. How would I make the box always snapped to the grip so the blocks would be an even distance apart instead of where ever the players put them? (EX. Shift+S selection to grid then ctrl+g+axis)

You can position objects via their worldPosition attribute.

Given a list of blocks to place, you can do this:


for i, b in enumerate(blocks):
    b.worldPosition.x = i

That should space them apart on the X axis by 1 blender unit.

thanks for the response :slight_smile: