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.

RuntimeNavMeshBuilder: Source mesh Combined Mesh (root: scene) does not allow read access.

Discussion in 'Navigation' started by roseportalgames, Nov 15, 2018.

  1. roseportalgames

    roseportalgames

    Joined:
    Aug 9, 2017
    Posts:
    173
    Hey guys, I'm getting this error when I run Bake on a NavMeshSurface:

    Code (CSharp):
    1. RuntimeNavMeshBuilder: Source mesh Combined Mesh (root: scene) does not allow read access. This will work in playmode in the editor but not in player
    2. UnityEngine.AI.NavMeshSurface:BuildNavMesh()
    3. <RebuildingNavmesh>c__Iterator7:MoveNext() (at Assets/Scripts/Minigame1/SecurityGame.cs:661)
    4. UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    5. SecurityGame:RebakeNavmesh() (at Assets/Scripts/Minigame1/SecurityGame.cs:656)
    6. <PlacingFence>c__Iterator8:MoveNext() (at Assets/Scripts/Minigame1/SecurityGame.cs:695)
    7. UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
    As far as I can tell there's no "combined mesh" in my scene (what is that, even?). If so, how could I find it..? I know that sounds stupid but there's just a few meshes turned on in my scene and upon looking at them I can't find "Combined" anywhere. I also have a cube (the ground with the NavMeshSurface) and a terrain (this is just for background visuals, it's not on the layer used by the NavMeshSurface).
     
  2. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    488
    You are somehow trying to change the combined mesh, which is stored in memory when you initialize your navMesh. Can you show the code in SecurityGame of the methods that contain the highlighted lines? (661, 656, 695)
     
  3. HorusVision

    HorusVision

    Joined:
    Jun 7, 2018
    Posts:
    4
    Is the object marked as static? I got this error while trying to build a navmesh out of multiple level objects (a ground plane and some buildings). I turned off static for all of the objects (and their children) and the error went away.
     
  4. craig4android

    craig4android

    Joined:
    May 8, 2019
    Posts:
    124
    having the same Problem, it does work if I use "Physics Colliders" as "use Geometry" option. But actually I want to use "Render Meshes"
     
    kumawatb003 and darkprova11 like this.
  5. IronHelmet

    IronHelmet

    Joined:
    May 2, 2017
    Posts:
    70
    err, yeah, my meshes need to be static for rendering.

    I found I still get the error when I choose Physics Colliders. I'm on 2019.2.9f1 right now
     
    Last edited: Jan 7, 2020
  6. X28

    X28

    Joined:
    Jul 15, 2015
    Posts:
    8
    I had the same issue when I changed assets to non-static (non-navigation static), it worked perfectly.
     
    Last edited: Dec 2, 2020
  7. lejean

    lejean

    Joined:
    Jul 4, 2013
    Posts:
    379
    Batching Static needs to be disabled
     
  8. jpeg_

    jpeg_

    Joined:
    Sep 5, 2017
    Posts:
    4
    Go to Project Settings >Player Settings->Other Settings and deselect "Static Batching"
     
  9. D4Q2

    D4Q2

    Joined:
    Oct 23, 2019
    Posts:
    1
    Thank you this worked!
     
  10. SirSkiz0

    SirSkiz0

    Joined:
    Nov 1, 2021
    Posts:
    1
    It works, how do you realize of such a think?
     
  11. RogerFK

    RogerFK

    Joined:
    Mar 30, 2020
    Posts:
    2
    Since disabling static batching might (or might not) be a "desperate" measure that gives up performance we tried another possibly desperate measure that I hope doesn't sacrifice anything (although it probably is a bad idea and very destructive):

    In the Project Window's search bar, just search
    t:Model
    and then Ctrl-A to select every model.

    This is a bit destructive, but if you select Read/Write and hit apply it just honestly works.
    I was thinking I also had problems with other models not being Read/Write in other instances, specially when importing from Blender so we thought: why not if I'm going to need it for new models anyways?
     
  12. AshyB

    AshyB

    Joined:
    Aug 9, 2012
    Posts:
    187
    Works in Linux 2021.3.20f1 if I use physics colliders. This should be ok for my situation.