Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

[FREE] Vegetation Spawner, procedural tool for the terrain system

Discussion in 'Assets and Asset Store' started by StaggartCreations, Aug 20, 2020.

  1. Ryan-Hayle

    Ryan-Hayle

    Joined:
    Feb 16, 2014
    Posts:
    142
    Are there any plans to fix the terrain details GPU Instancing from turning off? I had e-mailed you, but not sure if you have received it.
     
  2. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Still combing through the weekend's emails ;)

    The option to set the GPU Instancing toggle is actually missing, so it just gets set to 'false' all the time. This was introduced in Unity 2021.2, but kind of flew under my radar, so thanks for the heads up! I've just added the option :)

    1.0.8

    Added:
    - Option to toggle GPU Instancing for grass prefabs in Unity 2021.2+
    - If no grass items are set up, the option is present to grab them from a specific terrain object (first set up scenario).

    Changed:
    - A warning is now displayed if a grass prefab uses a LOD Group, which the terrain system does not support.
     
    Ryan-Hayle likes this.
  3. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    I forget where but the details panels also has an align to terrain % slider that could be useful.
    Just an FYI

    EDIT:
    Terrain > Details Tab > Edit Details > Edit > Align to Ground %
     
  4. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Ah excellent! Better late then never I suppose :D

    I see that's starting from Unity 2022.2, I'll add a parameter for this once it leaves the beta stage ;)
     
    HIBIKI_entertainment likes this.
  5. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    Yes indeed! Haha I'm a little ahead of the game in that part I forgot to mention :p
     
  6. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    Do you know why this happens?

    The only way the grass shows is if I click Camera facing billboard. I'm using Unity 2021.3.6f1.
    Thanks
     
  7. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Thanks for this great tool! But I'm having trouble spawning grasses. Trees work fine, but grasses always fail to be spawned, throwing this error...what does it mean? The grass objects are not added to the terrain's Detail Objects list.

    Detail index out of bounds in DetailDatabase.SetLayers
    UnityEngine.TerrainData:SetDetailLayer (int,int,int,int[,])
    sc.terrain.vegetationspawner.VegetationSpawner:SpawnGrassOnTerrain (UnityEngine.Terrain,sc.terrain.vegetationspawner.SpawnerBase/GrassPrefab) (at Assets/VegetationSpawner/Runtime/VegetationSpawner.Grass.cs:278)
    sc.terrain.vegetationspawner.VegetationSpawner:SpawnGrass (sc.terrain.vegetationspawner.SpawnerBase/GrassPrefab,UnityEngine.Terrain) (at Assets/VegetationSpawner/Runtime/VegetationSpawner.Grass.cs:138)
    sc.terrain.vegetationspawner.VegetationSpawnerInspector:DrawGrass () (at Assets/VegetationSpawner/Editor/VegetationSpawnerInspector.cs:774)
    sc.terrain.vegetationspawner.VegetationSpawnerInspector:OnInspectorGUI () (at Assets/VegetationSpawner/Editor/VegetationSpawnerInspector.cs:175)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
     
  8. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Following the breadcrumbs, there is a terrain missing that was previously added to the component. If so, there is a "One or more terrains are missing" error message displayed at the top of the inspector.

    You can simply hit the "Add active terrains" button under the Terrains tab to remove the null item.
     
  9. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Thanks for the tip, but that doesn't seem to be the problem. I cleared all terrains from the VS panel, then clicked Add Active Terrains, and it added all of them. Then I tried Respawning one of the grass/detail objects, and the progress indicator shows it going through all the terrains, but fails with this same error on each one. No detail objects are added to the terrains. I don't see any message on the inspector or in the log saying "One or more terrains is missing."

    Trees spawn just fine, it's only grass/detail objects that don't work. Any other ideas?

    EDIT: Well, I created a new test scene and it works there. So I'll use that. Thx for the great tool!

    EDIT 2: Spoke too soon. So what I'm doing is:

    1) Set up VS on a game object.
    2) Copy and paste a terrain from another scene which has all the grass objects on it.
    3) Assign that terrain to the slot on the VS Grass panel and copy them over to VS. They all show up.
    4) Delete that terrain, then add all active terrains to VS terrain panel.
    5) Adjust some of the grass parameters, then click Respawn. VS shows the progress indictor, but it doesn't add the grass object to the terrains at all. No errors anymore, just no grass on the terrains....
     
    Last edited: Nov 23, 2022
  10. Bwacky

    Bwacky

    Joined:
    Nov 2, 2016
    Posts:
    211
    Similar issue here currently, 2021.3.14f1 with URP.
    Spawning somehow stopped working on terrains it worked fine before -trees pop up nicely, but detail objects just don't spawn anymore on terrains.
     
  11. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    I believe I know what you're running into, since you are using the "Fetch and convert grass items" button, for a new set up.

    I made a mistake by copying the grass min/max "length" value into the min/max height (variables are named similarly):
    upload_2022-12-1_14-6-42.png

    So it's likely your grass isn't visible because of the Height Range spawning rule. You can set the to 1000 to remedy this:
    upload_2022-12-1_14-8-56.png

    I'll be sure to correct this in next version update.

    You could verify is grass simply isn't rendering by manually painting it, as a test.
     
  12. Bwacky

    Bwacky

    Joined:
    Nov 2, 2016
    Posts:
    211
    It renders just fine with manual painting.

    As a temp alternative I used a different spawner I use sometimes when Vegetation Spawner fails me (MW) and it managed to spawn just fine, so I'd chalk it up to some bug or bad luck on my end.
     
  13. Crowsinger

    Crowsinger

    Joined:
    Apr 23, 2022
    Posts:
    19
    Hello. I'm not sure I understand "species", as when I add items, each prefab is added individually. Is there a way of grouping prefabs into species?

    Also I was wondering if there is a way of grouping similar items together in more natural patches. Things seem to spawn randomly here, but I was thinking of a patch of chicory, a path of heather, etc.

    Thanks

    upload_2023-1-18_9-20-11.png
     
  14. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    232
    I'm running into the same issue that you had @Bwacky , did you ever get grass to work?

    I checked the height attribute, and that wasn't it.
     
  15. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Have been using the tool recently in a practical project and took the opportunity to make a few UX changes. Particularly only spawning on visible terrains, which proved essential for quickly tweaking spawning parameters on a large landscape.

    upload_2023-3-11_8-50-42.png

    Version 1.0.9 is now up!

    For anyone familiar with the asset, please consider writing a quick review on the store page, this'll go a long way towards continuity of it.
     
    zetingq and backwheelbates like this.
  16. Bwacky

    Bwacky

    Joined:
    Nov 2, 2016
    Posts:
    211
    Regretfully no, had to give it up back then, but there's the new version out so I'll take it for a spin.
     
  17. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    @Bwacky @backwheelbates

    I expect if you're testing 2022 with terrain tools installed, you'll have to change the Terrain Components > Terrain Settings.

    Tree & Details Objects
    Details Scatter Mode can be changed from
    Coverage Mode to Instance Count Mode
    @Crowsinger Species is only supported for Trees, Where there is another [+Add] button under the Prefab header, this way, these are grouped together as "species" so that they don't collide with one another.

    Details don't have this as Unity doesn't use the same methodology at all to spawn details(it uses something to resemble hit points on a texture.

    @StaggartCreations Users may be referring to Detail Scatter Mode option, which is in Tech Stream
     
    backwheelbates and Bwacky like this.
  18. Bwacky

    Bwacky

    Joined:
    Nov 2, 2016
    Posts:
    211
    Actually - :D
    I had the pleasure of working with Vegetation Spawner all day yesterday (2021.3 LTS URP) and had zero issues, so one of the updates along the way must've fixed it.
     
    sirleto and HIBIKI_entertainment like this.
  19. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    Great news! glad to hear it.
     
  20. spikezart

    spikezart

    Joined:
    Oct 28, 2021
    Posts:
    72
    Hey, I've started to use Vegetation Spawner because I tend to get issues with Gaia that make building a world so much slower. VS is quick and easy. I'd certainly pay for a straight forward product as this.

    I do have one recurring problem in URP 2021.3.24f1. I've adjusted the spawn rate on a number of assets and it seems to trigger the following two errors:

    Code (CSharp):
    1. Tree removed: invalid prototype 5
    2. UnityEngine.StackTraceUtility:ExtractStackTrace ()
    3. sc.terrain.vegetationspawner.VegetationSpawner:RefreshTreePrefabs () (at Assets/VegetationSpawner/Runtime/VegetationSpawner.Trees.cs:55)
    4. sc.terrain.vegetationspawner.VegetationSpawner:SpawnTree (sc.terrain.vegetationspawner.SpawnerBase/TreeType,UnityEngine.Terrain) (at Assets/VegetationSpawner/Runtime/VegetationSpawner.Trees.cs:67)
    5. sc.terrain.vegetationspawner.VegetationSpawnerInspector:DrawTrees () (at Assets/VegetationSpawner/Editor/VegetationSpawnerInspector.cs:419)
    6. sc.terrain.vegetationspawner.VegetationSpawnerInspector:OnInspectorGUI () (at Assets/VegetationSpawner/Editor/VegetationSpawnerInspector.cs:175)
    7. UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
    Code (CSharp):
    1. ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    2. Parameter name: index
    3. System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <ee4485bb020b402fb901fb78b3f9a4cd>:0)
    4. sc.terrain.vegetationspawner.VegetationSpawnerInspector.GetTreeType (System.Int32 index) (at Assets/VegetationSpawner/Editor/VegetationSpawnerInspector.cs:307)
    5. sc.terrain.vegetationspawner.VegetationSpawnerInspector.DrawTrees () (at Assets/VegetationSpawner/Editor/VegetationSpawnerInspector.cs:345)
    6. sc.terrain.vegetationspawner.VegetationSpawnerInspector.OnInspectorGUI () (at Assets/VegetationSpawner/Editor/VegetationSpawnerInspector.cs:175)
    7. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Editor/Inspector/InspectorElement.cs:636)
    8. UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)
    Any suggestions would be gratefully received.
     
  21. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Glad its proving useful! That's certainly the intent :)

    If I follow the breadcrumbs of the stack trace, it seems the error stems from selecting (or attempting to) a tree item in the inspector, that doesn't exist.

    The inspector tracks an ID, for the selected item, and saves this in memory, so that when you come back to the Vegetation Spawner to readjustments, the previously selected tree is automatically selected again for you. I find it extremely annoying for UI's to do otherwise :p

    What I believe happens in your case, as an example, is that you select tree nr 5 in Vegetation Spawner component A. Then open Vegetation Spawner B (possibly in another scene) that only has ~3 tree items assigned to it. The result: item nr 5 is being re-selected, but results in an index out-of-range exception. Changing a spawning parameter in this case would have the tool attempt to spawn a tree on the terrain that also doesn't exist, leading to another error.

    So two Vegetation Spawner components are being used, in some way? Does that sound like the right context?

    This could all be patched by saving the selection ID, on a per-component basis, rather than project wide.
     
  22. spikezart

    spikezart

    Joined:
    Oct 28, 2021
    Posts:
    72
    Thank you for this. Yes I decided to use two instances, one for Trees and one for LOD grass (so added as trees). Ive now gone back to one instance with the objects all under trees.

    Can I simply delete an object from the selection in the species area to have all spawns of it removed from the scene?
     
  23. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Ah, that certainly makes sense then! I'll add some clamping of the selection ID, to avoid it ever going out of bounce. A quick way to do this, is to add these two lines to the OnEnable function in the VegetationSpawnerInspector class:
    upload_2023-5-15_11-25-0.png
    Code (CSharp):
    1.             if (selectedTreeID > spawner.treeTypes.Count) selectedTreeID = 0;
    2.             if (selectedGrassID > spawner.grassPrefabs.Count) selectedGrassID = 0;
    When you delete an item from the spawner, it'll also be deleted on the terrain(s) right away.
     
    spikezart likes this.
  24. tristan_unity52

    tristan_unity52

    Joined:
    Feb 24, 2023
    Posts:
    1
    Great asset! I'm really loving the item placement. I just can't spawn grass in an URP project, same as some other guys are saying. I've tried billboard textures as well as models. Not sure what could be happening here. Any ideas?
     
  25. Bwacky

    Bwacky

    Joined:
    Nov 2, 2016
    Posts:
    211
    Have you maybe considered doing something like area/biome spawns instead of only globally as it is now? :)
     
  26. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    I have, but at the time Unity did not have a native spline tool, which was a prerequisite (for defining areas). But in practical terms it also boils down to reworking many core design and functional aspects of the tool.
     
    Bwacky and spikezart like this.
  27. Nikovsk

    Nikovsk

    Joined:
    Mar 16, 2023
    Posts:
    15
    Excellent asset, Staggart !! Thank you.
     
    Last edited: Jul 10, 2023
    StaggartCreations likes this.
  28. ICEconchy

    ICEconchy

    Joined:
    Jul 22, 2020
    Posts:
    1
    Encountering the same issue here. Tried adding grass via trees but it quickly tanked my unity fps
     
  29. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    @tristan_unity52

    If you're both in newer editor versions, you may want to look at the newer scatter modes that unity introduced, depending on your project and other asset set ups. You may need to test between the two and this asset.


    Detail Scatter Mode:
    The scatter mode type to be used while painting details:

    Coverage paints areas details should be populated in based on their density setting.

    Instance Count paints the amount per sample.
     
  30. Cybex_IA

    Cybex_IA

    Joined:
    Aug 16, 2021
    Posts:
    2
    @StaggartCreations
    Hello good Sir.
    First of all, thanks a lot for your indeed very useful tool.
    I currently am using it again with the unity terrain that is providing the coverage system and ran into some troubles with grass not spawning when in coverage mode, as others have as I've read in here, so I decided to dig into it a bit and try to find what's not working. Found out that the coverage mode map works in range [0...255] not [0...1], so the fix is quite straight forward.

    At line 307 in VegetationSpawner.Grass.cs checking for the set mode:
    Code (CSharp):
    1.  
    2. map[x, y] = terrain.terrainData.detailScatterMode switch
    3. {
    4.     DetailScatterMode.CoverageMode => instanceCount * 255, // variant: max coverage
    5.     //DetailScatterMode.CoverageMode => instanceCount * (int)(Random.value * 255), // variant: random coverage
    6.     _ => instanceCount // 'Instance Count Mode' being default
    7. };
    8.  
    This fixes the issue. I've tested with three different grass billboard assets and spawned it in a couple of different ways, everything seems to work as expected. I've left but commented out the second line in the switch, one could do something like this to create variety in density maybe by just using Random or via a noise map, could lead to interesting results. I did not look deeper into how exactly the coverage system works so I can't tell you anything about the behind the scenes unity stuff, but I've tested the Random density and setting it to 127 instead of 255 and the density is affected per texel. A quick test using
    DetailScatterMode.CoverageMode => (int)(y * 8 % 255)
    for the density setting gave the following expected result. The patches are not from me though, this seems to be unitys noise based randomization.

     
    Last edited: Aug 15, 2023
  31. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Thanks for the details! I had looked into this mode when it was in beta, but couldn't really discern the difference, and it seemed to be functionality targeted the vegetation painting tools.

    If the coverage value is 0-255 that does suggest gradations of density are possible, which is rather ideal. I feel once its safe to drop support for 2021.3 it would be beneficial to adopt as a the sole method.
     
  32. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    Submitted version 1.1.0!

    Changelog:
    Example of using the terrain extension functions to remove trees at a given position:
    Code (CSharp):
    1.     public void RemoveHere()
    2.     {
    3.         Terrain terrain = null;
    4.  
    5.         RaycastHit hit;
    6.         if (Physics.Raycast(this.transform.position, -Vector3.up, out hit))
    7.         {
    8.             if (hit.collider.GetType() == typeof(TerrainCollider))
    9.             {
    10.                 terrain = hit.collider.gameObject.GetComponent<Terrain>();
    11.             }
    12.         }
    13.  
    14.         if (terrain != null)
    15.         {
    16.             //Terrain extension function
    17.             terrain.RemoveTreesAtPosition(this.transform.position, radius);
    18.         }
    19.         else
    20.         {
    21.             Debug.Log("No terrain found at position");
    22.         }
    23.     }
    Documentation of these functions isn't available, because they can be browsed in your IDE and have intellisense summaries to describe them.

    Tip: press CTRL+Space to browse all available fields and functions of an object after the period:
    upload_2023-8-24_13-5-36.png
     
    HIBIKI_entertainment likes this.
  33. Cybex_IA

    Cybex_IA

    Joined:
    Aug 16, 2021
    Posts:
    2
    Glad that my post was of some use to you. I've made some other changes to your code that are a bit specific to my own workflow, e.g. a change of the spawn probability of trees where a terrain layers intensity can be used as a cap value. This made it easy for me to create forest edges where trees at the edge are a smaller variant but the smaller variant is not spawned deeper into the forest area. As said, it's a bit specific and it involves a texture map created for that purpose that provides a gaussian blend edge detection but the results are quite ok looking I think. If you want to know what I did for inspiration or if you're interested in the changes I did to the code just let me know. Here's an example of forest edges created in my workflow:


    This is off topic but I'll be so rude including it here anyway. I've seen you make a post elsewhere in the forum about the terrain.Flush() functionalities. Did you ever find out something about this? I'm currently working on making the Soft Occlusion Tree system of unity work for a day/night cycle situation and have it basically working with still some minor problems though. Namely the billboards don't update their lighting unless the camera moves or terrain.Flush() is called. I'm currently searching for a way to trigger the terrain updating regarding lighting that unity does when the camera moves, terrain.Flush is way to expensive to call though.
     
  34. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    That certainly contributes to more believability! Ubisoft used a similar technique for forest edges, allowing a higher chance of younger trees to spawn towards the threshold.

    I believe you figured out what "Flush()" is for now :p

    All I know is that the billboard's final color is influenced by a static color for indirect light. By default this is set to white. It may be faster to parse all the terrain's TreeInstances and change the color to something that matches your time of day. I believe Terrain.Flush() may be doing the same, and applies RenderSettings.ambientSkyColor, but possibly also does a lot more than you may want.
     
  35. datagreed

    datagreed

    Joined:
    Sep 17, 2018
    Posts:
    45
    Thank you for the asset!

    In my case the grass spawner acts weirdly. I am on 1.1.0 on Unity 2022.3.16f, MacOS.
    Whenever I press "spawn" in grass section or "respawn grass" in Settings section, it doesn't spawn. However, it spawns every time I press "randomize" (even when seed number was already there). When the grass is spawned after rpessing "randomize" whenever I press "spawn" or "respawn grass", it just disappears.

    Also spawning doesn't seem permanent - every time I reload a scene it disappears.

    How can I solve it?
     
  36. datagreed

    datagreed

    Joined:
    Sep 17, 2018
    Posts:
    45
    I manage to solve the issue, but it was very weird.

    The terrain component had a brush missing. I don't know how it's even related to vegetation spawner but it worked when i fixed the brush (see the screenshot)

    Now I am getting an error from Vegetation Spawner when I enable the "collision check" checkbox. The error goes as follows:

    Code (CSharp):
    1. IndexOutOfRangeException: Index was outside the bounds of the array.
    2. sc.terrain.vegetationspawner.Cell.GetSubcell (UnityEngine.Vector3 worldPos, System.Single cellSize, System.Int32 subDivisions) (at Assets/VegetationSpawner/Runtime/Cell.cs:72)
    3. sc.terrain.vegetationspawner.VegetationSpawner.InsideOccupiedCell (UnityEngine.Terrain terrain, UnityEngine.Vector3 worldPos, UnityEngine.Vector2 normalizedPos) (at Assets/VegetationSpawner/Runtime/VegetationSpawner.Collision.cs:154)
    4. sc.terrain.vegetationspawner.VegetationSpawner.SpawnGrassOnTerrain (UnityEngine.Terrain terrain, sc.terrain.vegetationspawner.SpawnerBase+GrassPrefab item) (at Assets/VegetationSpawner/Runtime/VegetationSpawner.Grass.cs:223)
    5. sc.terrain.vegetationspawner.VegetationSpawner.SpawnGrass (sc.terrain.vegetationspawner.SpawnerBase+GrassPrefab item, UnityEngine.Terrain targetTerrain) (at Assets/VegetationSpawner/Runtime/VegetationSpawner.Grass.cs:161)
    6. sc.terrain.vegetationspawner.VegetationSpawnerInspector.DrawGrass () (at Assets/VegetationSpawner/Editor/VegetationSpawnerInspector.cs:826)
    7. sc.terrain.vegetationspawner.VegetationSpawnerInspector.OnInspectorGUI () (at Assets/VegetationSpawner/Editor/VegetationSpawnerInspector.cs:191)
    8. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.<CreateInspectorElementUsingIMGUI>b__0 () (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:713)
    9. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:190)
    10.  
    How do I fix it?
     

    Attached Files:

  37. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    I believe if there is something faulty regarding a terrain, Unity won't be able to properly save the vegetation data either.

    I unfortunately cant say much regarding the error, as the possible causes are so far and wide. Clicking the "Rebuild cache" button under the Settings tab may do the trick here!
     
  38. datagreed

    datagreed

    Joined:
    Sep 17, 2018
    Posts:
    45
    Thanks, unfortunately, rebuilding cache button didn't help (it's also weird that it says that it took 0ms to rebuild it in the log).

    Could you please advise if there is any way the terrain should be prepared for use with the vegetation spawner for the collisions to work? Should it have a Terrain Collider attached? If so, what should its settings be set to? If not, are there any requirements for the terrain itself? Where does the vegetation spawner take colliders from? I am not even sure where to look since I don't understand if the colliders are a part of the Terrain System or Vegetation spawner.
     
    Last edited: Apr 29, 2024
  39. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,290
    There aren't any special requirements to be considered. A terrain is expected to have an equal width and length, which is conventional. A terrain will always have a collider attached to it by default, but it is not required. Collision is detected through raycasts, so it involves only other colliders in the scene.

    If you are able to provide a minimal reproduction project, I'll be able to investigate why the error is thrown. There's bound to be something specific at the root of the cause that I can't think of.