Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Question How to selectively delete (or obscure) individual detail meshes during runtime

Discussion in 'Editor & General Support' started by karsten-heim, May 28, 2023.

  1. karsten-heim


    May 16, 2022
    I am making an RPG game, where the player can discard unwanted items from their inventory by throwing them on the ground. The problem with this though, is that thrown items are completely obscured by tall grasses that I painted on with the "Paint Details" tool in the unity terrain menu. These aren't treated like individual gameobjects like other meshes that I have used before, so I cannot simply check the distance from the object, and then toggle its active state if it's distance from the dropped object is less than a certain value.

    Ideally, what I want is for detail meshes within a certain radius of the gameobject to simply not be seen until the object is picked up, and also be triggered by a certain function which is called when the object becomes stationary.

    Does anyone know how to (temporarily) disable detail meshes in a certain area at runtime? Or maybe make them not visible?
  2. Kurt-Dekker


    Mar 16, 2013
    In the general sense this is problematic, as there are many ways that geometry gets drawn, not just MeshFilters and MeshRednerers. Could be text / UI, particles, etc.

    A better approach than turning off other geometry is to add some un-obscurable (eg, laid down in screenspace or else by a separate camera) glint or glow or outline to the object.