- Home /
Procedural terrain generation - What exactly does Terrain.Flush() do?
I am generating terrains procedurally. At first I thought I should call Flush() after any change but it seems it's not needed for most changes after some testing.
The manual is quite sparse on the subject:
Terrain.Flush
public void Flush();
Description
Flushes any change done in the terrain so it takes effect
So what exactly does it do? I suspect if I don't call it at the right time I may experience strange bugs...
Traditionally, in just regular computers, flush()
means: "I know you're saving up these changes and will automatically apply them at some point. I need you to apply them now." Compared to Apply()
, which generally means that this is the only way to make changes.
Thanks that's a good point! After some experimenting it seems that after changing terrain size and resolution of maps you need to call Flush() to make trees retain their positions. Still I would like to know exactly what it does...
Your answer
Follow this Question
Related Questions
how to create terrain on a sphere in script? 1 Answer
How can I get a Low Poly terrain to work in Unity? 2 Answers
Terrain Object Suddenly Not Editable 1 Answer
How can I create voxel based terrain ? 2 Answers
Terrain generation problem. 1 Answer