1 (edited by rodolphebansard 2020-06-29 09:28:47)

Topic: Instantiation of terrains from a folder

Hello,

I need to store the terrains I generated in a folder that is not part of my unity project.
How can i instantiate them with the same structure in a build?

Re: Instantiation of terrains from a folder

Hello.

You have three ways:
1. Streaming Assets:
https://docs.unity3d.com/Manual/StreamingAssets.html
2. Asset Bundle:
https://docs.unity3d.com/Manual/AssetBundlesIntro.html
3. Export all terrains maps, and create a dynamic terrain in the playmode and load maps using a script.
https://docs.unity3d.com/ScriptReferenc … nData.html
But keep in mind that dynamically creating terrains has many pitfalls.

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!

Re: Instantiation of terrains from a folder

Hello again,

Thank you, it works very well with asset bundle.

I just have a small problem.
When i built my project, the terrain was all pink (no problems in editor)
The "fix" i am using for the moment is to have a random terrain generated in the project.
if there is none, it does not work.
pretty weird to me.

Do you have any idea to make this cleaner ?

Thank you !

Re: Instantiation of terrains from a folder

Most likely the problem is that the terrain shader was not included in the build.
Add “Nature / Terrain / Standard” shader to “Edit / Project Settings / Graphics / Always Include Shaders”.

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!

Re: Instantiation of terrains from a folder

Thank you it works !
thanks for responding so quickly !

Have a nice day