- Home /
Minecraft style grid and block placement?
Ok, so I want to make a minecraft clone. It seems so simple but its actually insanely hard.
All I want is to know how to make a grid, and then place cubes on it.
Note: Cubes are default size.
I am using the FirstPersonController and I need to know where to put the scripts as well.
Hope someone can help me with this.
Also posted to forums here: http://forum.unity3d.com/threads/84258-How-to-place-blocks-like-$$anonymous$$ecraft-on-a-grid.
Start with getting the Fire button to just spit out a cube where you are. Then try to get it to pop out 3 units ahead of you. After that, draw several pictures of exactly where you want the cube to be and how it should be lined up, depending where you are when you drop it. "If my x/z is this, cube should be at that x/z."
Answer by Bunny83 · Jan 26, 2014 at 12:08 PM
Can't believe there's such an old thread about that topic. Anyways I'll post it here as well:
For future readers, there is also Unity Voxel Tutorial
If you want to have a good point to start off developing your voxel game you might want to check out my voxel engine at the unity assetstore: https://www.assetstore.unity3d.com/#/content/17470
Answer by JiffyJuff · Apr 20, 2013 at 07:19 AM
Make a "sensor" first. It's basically an empty gameobject with 6 planes added in to make it look like a cube. Then make scripts for the planes to create blocks. For example, the y negative plane would Instantiate a new block 0.5 y lower when clicked. Then put scripts in the original block to teleport the sensor to it's position when mouseovered. Now when you put your mouse over a block, a sensor appears and if you click on one of the sides a block will appear on the same side. The sensing script should be copied too.
Your answer
Follow this Question
Related Questions
Place block script 1 Answer
Snap blocks that aren't cubes. 1 Answer
transform.position error 1 Answer
Moving the cube in a grid cell by cell 0 Answers
Place block script ? help please :) 1 Answer