Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

terrain set height feature slider is broken and useless

Discussion in 'World Building' started by hippocoder, Feb 24, 2019.

  1. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Hi,

    The slider for set height goes from 0 to 2000, yet my terrain originates at -256..... so you can see how hopelessly useless this slider is.

    But, shift+click to sample will work, if a bodge workaround.

    Hoping UI team or something will find out about it.
     
    Rowlan likes this.
  2. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    I just checked the code. Looks like a bug. Slider goes from hardcoded 0 to terrain.terrainData.size.y.
     
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Doesn't go to terrain size y here :) just hardcoded at 2k regardless.
     
  4. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    We know about it haha. Might be better to just make it a FloatField, or a slider that ranges from terrainPos.y to terrainPos.y + terrainData.size.y since we dont have signed height values
     
    hippocoder likes this.
  5. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    455
    Even shift + click not working for me. Also it's annoying I can't make pit lower than terrain height. I need to rise ALL terrain, than use lower brush. This is all so uncomfortable.
     
    HenryTownshend and Zxen like this.
  6. Dwight_P

    Dwight_P

    Joined:
    Feb 26, 2013
    Posts:
    42
    Sorry for my ignorance, but where is the script for the terrain height located? I am having issues as well regarding my terrain max height and would like to tinker with it a bit to see if I can fit it. Currently, my terrain is at a 0.2:1 scale, so the height is rather small, using float values to do the height. (needed to be done for draw distance on terrain details)
     
  7. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    It's an internal script. What you can get is the one from the C# reference:

    https://github.com/Unity-Technologies/UnityCsReference/tree/master/Modules/TerrainEditor/PaintTools

    Although that's from 2018.3.0b12.
     
  8. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Ya. This is unfortunate and it's because the values stored in the heightmap are unsigned
     
  9. tcourbet

    tcourbet

    Joined:
    Oct 5, 2017
    Posts:
    46
    But didn't that behaviour change with the new versions of unity? (I'm currently on 2018.3.7f1)
    In previous versions, "0" was the terrain's 0 (meaning that if your terrain started at -256, 0 would be -256) but now it became an absolute value. Or am I missing something?
    It's really really annoying not being able to use set height under 0 and having to lower the height manually...
     
    Stardog likes this.
  10. eXiin

    eXiin

    Joined:
    Dec 23, 2013
    Posts:
    63
    I just did a bug report about the terrain issue (1150178)

    Set height and sample target height on terrain is broken

    1. What happened

    It's not possible to sample the target height on a terrain if the Y axes is not between 0 and 600
    That happen since unity 2018.3.7 and still happen on 2018.3.14

    2. How we can reproduce it using the example you attached

    Step 1:
    • a. Create a terrain, make sure it's 0,0,0
    • b. Use the "set height" tool and raise the terrain
    • c. Hold control and click to sample the height
    • d. draw with it and it works as expected

    Step 2:
    • a. Move the terrain to 0,-250,0
    • b. Use the "set height" tool and raise the terrain
    • c. Hold control and click to sample the height
    • d. the sample height stay at 0, it's not possible to pickup the height

    Step 3:
    • a. Move the terrain to 0,700,0
    • b. Use the "set height" tool and raise the terrain
    • c. Hold control and click to sample the height
    • d. the sample height stay at 600, it's not possible to pickup the height anymore
     
    akareactor, Dwight_P, arfish and 2 others like this.
  11. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
    Can just agree to that. Set terrain height tool is broken in 2018.3.
    Have you filed a bug report for it?
     
  12. eXiin

    eXiin

    Joined:
    Dec 23, 2013
    Posts:
    63
  13. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,910
    Damn this is annoying. 3 months and no fix for this?

    The Flatten button is broken. It does some kind of world space adjustment and doesn't take into account the current terrain Y position.

    Workflow:
    • Set terrain height to 512 (Terrain Settings > Mesh Resolution)
    • Flatten to 256
    • Move to 0, -256, 0. Now the ground is the "middle" of the height, so we can create 256 deep water and 256 high mountains.
    • Flatten to 256 again. The terrain disappears from the screen. You have to move it to -512 to find the ground, but you can't paint the terrain higher. Flattening to any other number does nothing.
    I have no idea what signed height values are, but if we didn't have them with the old terrain then it should be no different.
     
    commonolithic and id0 like this.
  14. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    455
    Agree, flattern is broken and unusable, and you can't even set terrain on some height and than lower some parts, because negative values not support. It's make terrain editing almost impossible.
     
  15. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Can you all provide a video of the issue so I can get a better idea of what is not working for you? I might be able to get a fix into our Terrain Tools package. Getting fixes into Editor Source would take a lot longer
     
  16. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    This would be for 2019.1 and up though. I am not sure if the package will work in 2018.3
     
  17. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    455
    Just move terrain object somewhere down or up and Set Height brush already do things wrong.
     
  18. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    @wyatttt I took a brief look at the code here:

    https://github.com/Unity-Technologi...les/TerrainEditor/PaintTools/SetHeightTool.cs

    It seems like the variable

    Code (csharp):
    1. m_HeightWorldSpace
    is being considered using the terrain y position, e. g.:

    Code (csharp):
    1. m_HeightWorldSpace = terrain.terrainData.GetInterpolatedHeight(editContext.uv.x, editContext.uv.y) + terrain.transform.position.y;
    However, in the inspector it's being clamped between 0 and the terrain height:

    Code (csharp):
    1. m_HeightWorldSpace = EditorGUILayout.Slider(styles.height, m_HeightWorldSpace, 0, terrain.terrainData.size.y);
    ie the terrain's y position is missing in the inspector min and max values.
     
    wyattt_, AlanPT and id0 like this.
  19. eXiin

    eXiin

    Joined:
    Dec 23, 2013
    Posts:
    63
  20. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    74
    Fixed in core Unity as of 2019.3.0a11. (not including Terrain Tools version, will get Wyatt on that :) )
     
    wyattt_, Rowlan and hippocoder like this.
  21. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    74
    In 2019.3.0a11, you can get either behavior by choosing whether you want local or world space:
    upload_2019-7-26_15-24-44.png

    upload_2019-7-26_15-25-4.png
     

    Attached Files:

  22. tcourbet

    tcourbet

    Joined:
    Oct 5, 2017
    Posts:
    46
    Finally!
    This is great news, thanks!
     
  23. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    118
    Hello @ChrisTchou, we're close to release, will it be fixed on production ready versions of Unity?
     
  24. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    74
    Hmm, the fix will be difficult to port back to 2018.4, as it's built on top of a lot of other changes and fixes in 2019.*.

    I attached a modified SetHeightTool script, that you can just drop into your 2018.4 project to override built in tool and change the height value to terrain space. Just remember to remove it if you ever upgrade to the 2019 series. :)
     

    Attached Files:

    arfish, tcourbet and Rowlan like this.
  25. sebsmax

    sebsmax

    Joined:
    Sep 8, 2015
    Posts:
    118
    Last edited: Aug 5, 2019
  26. Azdesarel

    Azdesarel

    Joined:
    Jun 9, 2018
    Posts:
    4
    Buenas tardes, me gustaría comentar que todavía tengo problemas con la herramienta SetHeightTool, y de hecho ya he probado las siguientes verificaciones y no me ha funcionado en absoluto. No puedo hundir el suelo más allá de su altura a menos que primero eleve todo y luego lo hunda, probé con las verificaciones:

    2020.1.0a3 (alfa)
    2019.3.0b4 (beta)
    2019.2.6f1 (último oficial)
    2019.1.2f1
    2019.1.1f1

    Si alguien tiene una solución o consejo, lo agradecería mucho, ya que recién estoy comenzando en esta área

    Buenos días a todos y gracias por la atención prestada
     
  27. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    455
    Azdesarel пиши по английски, мутант. Никто не будет сидеть переводить чего ты написал тут.
     
  28. Azdesarel

    Azdesarel

    Joined:
    Jun 9, 2018
    Posts:
    4
    thank you human I'll keep it in mind for the next
     
  29. Azdesarel

    Azdesarel

    Joined:
    Jun 9, 2018
    Posts:
    4
    Good afternoon, I would like to comment that I still have problems with the SetHeightTool tool, and in fact I have already tried the following verifications and it has not worked at all. I can't sink the ground beyond its height unless I first raise everything and then sink it, I tried the checks:

    2020.1.0a3 (alpha)
    2019.3.0b4 (beta)
    2019.2.6f1 (last official)
    2019.1.2f1
    2019.1.1f1

    If anyone has a solution or advice, I would greatly appreciate it, since I am just starting in this area

    Good morning everyone and thanks for the attention given


    translated with goolge
     
  30. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    This bit is a separate issue I think and unfortunately this is how Heightmaps currently work in Unity. The Heightmaps store signed values but we treat Heightmaps on Terrain as unsigned so those values can't go below 0 ( which ends up being a local height of 0 and thus the y position of the Terrain GameObject )
     
  31. Azdesarel

    Azdesarel

    Joined:
    Jun 9, 2018
    Posts:
    4
    [QUOTE = "wyatttt, post: 5008646, member: 1809376"] Creo que este bit es un tema separado y desafortunadamente así es como Heightmaps funciona actualmente en Unity. Los mapas de altura almacenan valores firmados, pero tratamos los mapas de altura en terreno como sin signo para que esos valores no puedan ir por debajo de 0 (lo que termina siendo una altura local de 0 y, por lo tanto, la posición y del objeto de juego de terreno) [/ QUOTE]

    1: thank you very much for responding
    2: Then I should open a new topic?
    3: does that mean there is no way to fix it? I ask why ChrisTchou commented before it was resolved in the 2019.3.0a11 version and it is not working as it should

    translated with goolge
     
  32. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,910
    How do we fix this for 2019.2?
     
  33. Ereroa

    Ereroa

    Joined:
    Apr 27, 2017
    Posts:
    10
    My terrain somehow works like this. Unity 2019.1.13
    For both Set Height Brush and Smooth Brush.


    Works fine when I create new project. But on my current project even after deleting all the tools I downloaded this won't get fixed.
     
  34. IronHelmet

    IronHelmet

    Joined:
    May 2, 2017
    Posts:
    85
    Hey, since there is some activity here on this thread. Did you guys know that terrain data is not checked of version control when edited (All other assets I have found do). You have to manually check out and check in.