- Home /
TerrainGeneration
Hi, this is my first post here in Unity Answers and I'm on here because I am completely stumped I am currently trying to generate some terrain though a script (I am trying to use the TerrainTollkit API) but I keeping getting the same error:
NullReferenceException: Object reference not set to an instance of an object
here is my current script. Its not done I know but I am testing it in a iterative manner to help control errors.
var voronoiTerrain : GameObject;
/*
var randCell : Random.int;
var randFeature : Random.float;
var randScale : Random.float;
var randBlend : Random.float;
*/
function Start ()
{
voronoiTerrain = GameObject.Find("Terrain");
voronoiTerrain.GetComponent("TerrainToolkit").VoronoiGenerator(FeatureType.Mountains, 32, 0.9, 0.5, 1.0);
}
function Update ()
{
Debug.Log("Test: " + voronoiTerrain.GetComponent("TerrainToolkit"));
}
A little help would be appreciated because it is bugging the heck out of me...
Oh and I am using Unity 3.4.2
Answer by StarkDublin · May 03, 2012 at 04:14 AM
I actually figured out my problem. I needed to access the TerrainToolkit with a c# script and it worked just fin thank you for your views
Your answer
Follow this Question
Related Questions
Keep height at edge TerrainToolkit 0 Answers
Collider problem with terrain generated using terrain toolkit (dev build) 0 Answers
Terrain Toolkit and Texturing via Code HELP! 1 Answer
How do I return the Terrain tab to the Main Tool Bar? 2 Answers
How to make toon shader work with terrain place trees? 1 Answer