How do i snap cubes together like minecraft

im making a minecraft replica and how do i snap cubes together

all i want is to snap multiple cubes together like minecraft please and thanks.

Stop spamming the same question all over! http://answers.unity3d.com/questions/48685/how-to-place-blocks-like-this http://answers.unity3d.com/questions/48677/how-do-you-make-a-script-like-this http://answers.unity3d.com/questions/48512/how-do-i-snap-cubes-together-like-minecraft http://answers.unity3d.com/questions/48693/how-to-place-blocks-beside-eachother-perfectly-in-fps http://answers.unity3d.com/questions/48465/how-do-i-snap-in-place-with-a-cube

http://www.cubelands.com/ did you see this?

1 Answer

1
function Update()
{
   if (playerFullfillsConditionsToSnapCubesTogether)
   {
      SnapCubes();
   }
}

function SnapCubes()
{
   transform.position = VariableThatMakesACubeAppearToSnapNextToAnotherCube;
}

function UnspecificQuestion()
{
   if (UserAsksUnspecificQuestion)
   {
      UserRecievesUnspecificAnswer();
   }
   if (UserCanBeMoreInformativeInTheirQuestion && UserEditsQuestionToIncludeRelevantData)
   {
      UserRecievesALotBetterHelp();
   }
}

I need help i added this code on the script and it gave me like 7 errors help!

Cyclops: You were one comment too early :)

keith: Maybe you should read the code and see what the problem is.

I'm afraid Keith that you need a lesson in life:~ Look before you leap! in this case it means:- Read the script before using it. You will realise that it was an ambiguous piece of code which was ment as guide as to roughly how you would go about it. also a bit of a joke with the "function UnspecificQuestion" part which means if you ask an upspecific question you will get an unspecific answer. Bravo, you're noobishness made me laugh.

This brought a smile to my face at 8:20 on a monday morning and therefore, for the irony of it all, I had to +1 Keith's comment even though I know it defeats the purpose of upvoting comments. :-D