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

Bug Terrain Brush Functionality is Disabled

Discussion in 'World Building' started by Mortalanimal, May 25, 2021.

  1. Mortalanimal

    Mortalanimal

    Joined:
    Jun 7, 2014
    Posts:
    566
    So, I am not sure what causes this to happen, I am able to click on and select what I would like to paint, weather its a tree/detail/grass etc.. and I see the Gizmo range circle on the terrain, but When I click I dont draw anything.

    What causes this to happen:
    1) randomly (low chance)
    2) after adding prefabs (trees etc, to the terrain tool) (10-20% chance)

    Fix:
    Reset unity (works 100%)
    Make any amendment to any Script, even if its just adding a comment (50% chance to fix)

    Things I tired and failed:

    Code (CSharp):
    1.  public void flush()
    2.     {
    3.         References();
    4.      
    5.         terrainRef.terrainData.RefreshPrototypes();
    6.         terrainRef.Flush();
    7.         UnityEditor.EditorUtility.SetDirty(this);
    8.        // UnityEditor.TerrainLayerInspector.
    9.         UnityEditor.EditorUtility.RequestScriptReload();
    10.         UnityEditor.AssetDatabase.Refresh();
    11.         UnityEditor.EditorApplication.update();
    12.     }
     
  2. Mortalanimal

    Mortalanimal

    Joined:
    Jun 7, 2014
    Posts:
    566
    Found a temp Fix (Unlock and relock the Inspector that contains the terrain script)..

    Locking it seems to be causing the issue, this is pretty annoying considering how important it is to lock the Inspector while working with the terrain tool