TerrainData available in scene view

Hi,

I’m currently learning Unity and I am confused by one thing:

When I change some GameObject in runtime in the Start() method and I stop the game and go back to the scene view, the GameObject is “back” where it was at design time. But when I set data to a terrain in the Start() method via TerrainData.SetHeights(), this terrain data is still available in scene view after stopping the game. Do I have a misunderstanding?

Thanks in advance!

Anything that is located in a “scene” will be reverted when playmode is stopped to the state before you entered playmode. However any changes to assets in the project will persist. So changing the settings a a Material asset, texture import settings and also changes to ScriptableObjects which are stored as asset in the project. The TerrainData is just a ScriptableObject asset store in your project. The Terrain object is located in the scene. That’s why changes to the TerrainData will persist while changes to the Terrain (like replacing the TerrainData reference) will not persist.

Thank you very much for this explanation!

Could you by chance point out anywhere in the documentation where this is covered more in detail what happens between scene mode and play mode?

Thanks again!