- Home /
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.
Thank you for your reply guitarxe, i did exactly what you described after a little more searching. It was a little frustrating at first but i got the hang of it now i think. :)
Answer by guitarxe · Dec 11, 2013 at 04:30 PM
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?
Your answer
![](https://koobas.hobune.stream/wayback/20220613123930im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How do I know if trees in the asset store are paintable? 0 Answers
Unity terrain get invisble when i add a new asset 0 Answers
Terrain Assets Error!! 1 Answer
Cant import Terrain Assets 3 Answers
Selling with standard assets. 2 Answers