Search Unity

Generating Blocks

Discussion in 'Scripting' started by Toggy11, Jan 4, 2014.

  1. Toggy11

    Toggy11

    Joined:
    Jan 4, 2014
    Posts:
    6
    Hello I am trying to create a minecraft like game (Not a straight out copy its going to be a world in space when you can't break blocks though and you have to do missions).

    I was wondering how I would make a generate script so far I presume I have to have a object called "Chunk" then when I load the game it generates the terrain in a 16x16 area. Though I really don't know how to create grass blocks. For example I want to have a grass object already made then just clone it and place it at its new positions. Then get its position and place one block below it dirt then do that again 2 times then stone etc. Please any code would be useful on how to do this?
     
  2. Amon

    Amon

    Joined:
    Oct 18, 2009
    Posts:
    1,384
    Why not learn the basics first before jumping in to a Minecraft clone? You're setting yourself up to fail because you do not have the basic programming foundations in place that you need.

    There are a few threads ( use search tool ) on these forums and also kits on the asset store that save you the mother of all headaches when wanting to remake Minecraft. Even then though understanding what is happening in the code of these kits or tutorials may as well be written in Japacheese when a foundation of basic programming concepts is not well implemented and learned within your mind.
     
  3. Toggy11

    Toggy11

    Joined:
    Jan 4, 2014
    Posts:
    6
    I have learned alot of scripting and I am using javascript which before I got into unity3d used ALOT. I know that I need to generate a chunk and that is what I'm doing though I need help on cloning the generated grass block so it has the same properties as another grass block.
     
  4. Toggy11

    Toggy11

    Joined:
    Jan 4, 2014
    Posts:
    6
    Nevermind I have worked it out.