Placing textures
I want to duplicate this texture all over the terrain like how it's done in Minecraft. Thanks in advance.
Answer by Jason2014 · Feb 24, 2016 at 06:07 PM
In case when you have terrain you have to select option in the middle (brush icon) and set specified texture.
But if you want to make Minecraft clone, terrain is useless. Minecraft world is made from separate cubes and most efficient way to do this is from for loop.
Take a look:
using UnityEngine;
using System.Collections;
public class BasicWorldGeneration : MonoBehaviour
{
public GameObject Block;
public int AmountX;
public int AmountY;
public int AmountZ;
void Awake ()
{
for (int x = 0; x < AmountX; x++)
{
for (int y = 0; y < AmountY; y++)
{
for (int z = 0; z < AmountZ; z++)
{
Instantiate (Block, new Vector3 (x + 0.5f, y, z + 0.5f), Quaternion.identity);
}
}
}
}
}
This is a very basic world generation with configuration. You can select a block and adjust rows in all axes.
Browse series in Youtube. There are many tutorials how to make Minecraft in Unity.
Your answer
Follow this Question
Related Questions
Things Placed With Pin Detail Not Showing Up? 0 Answers
How to handle multiple terrains? 0 Answers
How can i make a planet in unity 5? 2 Answers
TreeInstance is not working properly 1 Answer
Border around procedural height map 1 Answer