Search code examples
unity-game-engineruntimescalingterrainarcore

Runtime Terrain Scaling Unity


I am currently working on an AR project using AR Core and Unity, and I have run into a problem.

I am scaling and rotating AR objects in runtime and that is all going fine, but now i have a terrain and water (Unity water asset) that i am trying to scale and that is going really badly since the terrain is just is gone, it does not appear at all, and the water is glitching.

So anybody any idea of why this is and maybe what i could do to try to fix this?

Note: I am using Lean Touch (Free Unity asset from the Unity store) to be able to scale and rotate AR objects while using the app.

Thanks in advance.


Solution

  • The terrain cannot be rescaled like other gameobjects. You need to set its resolution instead.

    For runtime, you should make use of its TerrainData https://docs.unity3d.com/ScriptReference/TerrainData-size.html

    I have not used any of the assets you mentioned, so I am not sure how they are affecting your results.