Can a Terrain (or any asset) be created during built game time?

Greetings to all,

What I am trying to achieve is to be able to create a new terrain from a heightmap (or even some other form of data), just like unity does in the editor (or the TerrainImporter.js editor script does), but in game time.

I don’t want to go too far at first. Just be able to make a new Terrain and apply a heightmap stored in a local drive to it.(Ideally, I’d want to be later able to retrieve the height data from the web).

I thought of trying to modify TerrainImporter.js, to make it run on runtime, but i am not really sure if that is possible or how to proceed.

If creating a completely new asset in built game is not possible, how would you guys approach this? Could I store some empty “flat” terrains of different sizes and resolution in my assets folder and then use external data to modify their heights?

(In the same manner, is it possible to Load a completely new model provided from an outside source at game time?)

Thank you in advance.

Well, you can’t really create editor assets during run-time. But why don’t you solve this programmatically? Write a class to handle the heightmap data that you can pull from either a file or like you want from online somewhere, which then instantiates a new terrain object to use your heightmap?