save terrainData into the file at the runtime and load it

hello
I tried to assign the textures to the terrain and insert the trees on it at the runtime
But after closing the game and reopening it, there is no trace of what I did last time
Is it possible to save the terrain data into the file and load it in the next run?

Changes to assets or scenes made at runtime would have to be replicated again at the next runtime. The Unity Editor functionality to save scenes and assets does not exist in a build. So you’ll need to record whatever you’re doing to your own save file, and when you load the save file you use the data to do the same changes to the assets or scene again. There’s lots of threads on save game systems which cover a lot of this in more depth.

1 Like

Everything that Uncle Joe says above is spot on. This is just basic load / save and oceans of digital ink have been splashed all over the planet about how to do it. It’s a very well-travelled area of study and requires a lot of attention to detail. I have even held forth on it myself:

Load/Save steps:

Don’t use the binary formatter/serializer: it is insecure, it cannot be made secure, and it makes debugging very difficult, plus it actually will NOT prevent people from modifying your save data on their computers.

2 Likes

oh bad ! terrain data , navigation data , … nothing can not save and load again , why !
How can I record all the trees, grass, and alpha-map textures that the user creates at runtime and re-apply all the changes in the next run before logging in?

I do not care if the user changes
Can it be save and load using serialize method?

Because like I said, those are Editor features. Take a look at your build some time, and try to find the Assets folder. Find your original scene files and individual asset files which you would want saved with changes at runtime. That should give you an idea.

1 Like

@none3d Can you share the script in which you have change terrain texture at specific point