Hi there,
I have 2 terrain objects in the scene (it will be more), how to change activeTerrain when my character moves from one to another?
Thanks,
Kulver
Hi there,
I have 2 terrain objects in the scene (it will be more), how to change activeTerrain when my character moves from one to another?
Thanks,
Kulver
Triggers?
Try out the “Activate Trigger” code in the standard assets…
Well…the question is not about how to trigger some action on some condition, but about how to tell Terrain runtime object that it have to switch to new Terrain object that was loaded for example.
transform.position.y = Terrain.activeTerrain.SampleHeight(transform.position);
how to change Terrain.activeTerrain ?
Regards…
You can’t control which terrain is referenced by the activeTerrain property, it’s set as the first terrain that was loaded.
ammm…then how do you do that streaming terrain thing?
LoadLevelAdditive all the time ?
Use GetComponent() to get the Terrain component attached to the particular terrain game objects you have. That way you can access each individual terrain uniquely. The activeTerrain property is just a more convenient way of doing things in those cases where you have a single terrain.
Ok, thank you , i’ll try now …
10 min later…
it’s working indeed… =)
Thanks again!
It is … insane … that activeTerrain is just the “first one loaded” ![]()