Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by helloiam · Jan 11, 2013 at 11:24 AM · terrainminecraftperlin noise

Perlin noise for (sort of Minecraft) terrain generator

I want to make a perlin noise in Unity3D in the terrain, I don't know exactly what it means but I guess it makes the terrain mathematical fun!

So here is the code of my terrain generator:

`using UnityEngine; using System.Collections;

public class GenerateWorld : MonoBehaviour {

 public int x;
 public int y;
 public int z;
 
 public Transform prefab;
 
 void Start () {

     for(int a = 0; a < x; a++)
     {
         for(int b = 0; b < y; b++)
         {
             for (int c = 0; c < z; c++)
             {
                 Instantiate(prefab, new Vector3(a, b, c), Quaternion.identity);
             }
         }
         
     }
     
 }
 
 void Update() {
     
     if(x < 0) {
         
         x = 0;
     }
     
     if(y < 0) {
         
         y = 0;
     }
     
     if(z < 0) {
         
         z = 0;
     }    
     
 }
 
 void OnGUI() {
     
     GUI.Box(new Rect(Screen.width/2 - 350, 10, 700, 25), "The values you typed in are: " + x.ToString() + " " + y.ToString() + " " + z.ToString() + ". All values must be above zero, please!");
 }

}

So anyone who can help me to put the perlin noise code inside my code, so I would have the future to add perlin noise to my terrain.

And sorry for my English I am from the Netherlands.

Thanks in advance. (PS: If you don't understand me, ask me any questions)

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kiloblargh · Jan 11, 2013 at 07:20 PM 0
Share

if you're looking for a faster way to say "sort of $$anonymous$$ecraft terrain," it's "voxel."

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Graham-Dunnett · Jan 11, 2013 at 11:27 AM

Just use one that someone has written already:

http://wiki.unity3d.com/index.php?title=TerrainPerlinNoise

Google is your friend.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image helloiam · Jan 11, 2013 at 05:28 PM 0
Share

Error: The script needs to derive from $$anonymous$$onobehaviour, what to do?

avatar image Bunny83 · Jan 11, 2013 at 08:14 PM 0
Share

The text starts with "This Editor wizard ...", so it's an editor script and not a $$anonymous$$onoBehaviour script. Just place it in a folder named "editor". For example

 Assets/editor/TerrainPerlinNoise.cs

When the script is compiled you should have a new menu item in called "Generate from Perlin Noise" inside your "Terrain" menu.

If you want to use it at runtime you have to adapt it into one of your scripts. If you have no idea how to do this, then you should start with something way simpler.

avatar image helloiam · Jan 14, 2013 at 08:41 PM 0
Share

Thanks for your help! I did it.

avatar image
0

Answer by Bunny83 · Jan 11, 2013 at 11:50 AM

Just in case you've missed it, there's a Minecraft-starter-package out there for free.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Minecraft-like ore generation 1 Answer

Add perlin noise to blocky terrain 0 Answers

Random Terrain Generation (Trees, Details, Textures) by passing a Seed? 0 Answers

How exactly is Perlin Noise implemented? 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges