- Home /
How to snap cubes together like Minecraft?
I just now picked up Unity and Ive gotten pretty far in my game, but Im stuck. How do I make it so that when I place my mouse over a cube and left click it, it will create a block that is connected to the others; like Minecraft (or Fortresscraft). Please explain how it works to (if you want) so that I understand what Im doing.
Answer by Statement · Jul 31, 2011 at 04:46 PM
Check out this similar question's answer with source code, live example and downloadable unity package.
It works by sampling the normal of the hit cube surface to determine which way the new cube should be placed.
It's just a few lines of code.
Answer by Goldgamer315 · Nov 06, 2011 at 08:52 PM
This may help you: http://www.mediafire.com/?w422rfx80jcws4s
You can thank me later :)
Your answer
Follow this Question
Related Questions
Snap blocks that aren't cubes. 1 Answer
Place cubes? problem with my script :S 1 Answer
Cube style terrain 1 Answer