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

Painting trees outside a terrain

Discussion in 'Getting Started' started by ToTomki, Aug 22, 2020.

  1. ToTomki

    ToTomki

    Joined:
    Aug 21, 2020
    Posts:
    2
    Hey, I just started my adventure with level designing in Unity. I've tried to place multiple trees at once using 'Paint trees' feature with 'Random tree rotation' checked. It required adding LOD to trees. I added it (only one level of detail).
    The issue is, I can add a new tree to my terrain only by dragging my tree from the project menu (first screenshot, marked as '1') to a terrain.
    When I try to paint trees, they show up out of my terrain and they are not rotated. Also, trees disappear when I come too close to them.

    Can someone explain me what I do wrong? How can I just paint trees there, were I click my brush, not outside a terrain?


     
  2. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,236
    In the prefab, does your LOD0 object have a position of 0,0,0?

    If not, it will not be positioned at the pivot point of the parent object (the LOD group)
     
    Neal67 likes this.
  3. ToTomki

    ToTomki

    Joined:
    Aug 21, 2020
    Posts:
    2
    Thanks for answering me. I'm not really sure what exactly you mean by 'In the prefab' and 'LOD0 object'. In the second screenshot (is it 'LOD0 object' you mentioned?) we see it has a position of 0,0,0. I see this window when I double click my tree in the panel with assets (is it 'prefab'?).

    One more clue that may lead to solution of the issue: when I use the brush, trees are not only moved into some other direction. When I click in the place you can see on the following screenshot (in a one point, I was not moving the brush), trees are painted not only far from the brush, but also 'around' it.

     
  4. unity_JOnZj17Ep8zmfg

    unity_JOnZj17Ep8zmfg

    Joined:
    May 3, 2018
    Posts:
    1
    Did you ever get this resolved, I have the same issue. Thanks!
     
  5. Mortilicious

    Mortilicious

    Joined:
    Oct 15, 2021
    Posts:
    7
    For anyone stumbling across this post (like me) and needing to solve this as a beginner, try taking these steps:

    • Create an empty object in Unity (called parent object from here on out)
    • Drag your object you want to paint with into this empty object as a child
    • On the parent object, add a component called "LOD Group"
    • (In my case) I deleted all LOD groups except the first. Click it, and below there is a box called "Renderers". Press the + sign and add your child object here (the object you want to paint with)
      • You can drag the LOD group to determine camera distance
    • Drag the parent object to your Unity project windows. This creates a prefab of it
    • Open the newly created prefab either through the project screen or the hierarchy screen (Prefab-> Open in Isolation)
    • In the prefab editing screen, click on your parent object and in the inspector click on the 3 dots at the top right of "Transform". This should show you an option "Reset position". Click it so that the position is now 0,0,0
    • Do the same for the child object
    • Exit the prefab editor with the tiny arrow in the top left
    • In the terrain painter, add your parent object by using "Edit Trees" and press "Add tree"
    • You should now be able to paint with it