Placing objects on a grid?

I’m working on a Starbound / Terraria clone, and my current issue I’m encountering is letting the user place pre-made objects/blueprints on a vertical grid level. As you can see in the video below, I have no issues with the player-spawning of the objects, but I am having trouble with them overlapping already placed objects (not to mention it doesn’t look nearly as good as a grid placement would).

So I was wondering if anyone has done something like this before or has any general advice on how I should go about accomplishing it?


Edit: one sec. need to check something

I think i got it, divide the values by you block size then make it whole numbers without .022424 and then multiply by block/grid size, should work.