Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Physics.BakeMesh() is not thread safe

Discussion in 'Physics Previews' started by Carpet_Head, Apr 23, 2020.

  1. Carpet_Head

    Carpet_Head

    Joined:
    Nov 27, 2014
    Posts:
    258
    I definitely remember reading somewhere that physics.bakemesh is thread safe. I guess it is in most situtations, but my understanding of thread safe was essentially that it could be ran on another thread without considering any other issues.

    The issue is that modifying the mesh during a bake operation can cause errors, and hard crashes. This is something that is possible to work around, but definitely isn't clear from the documentation

    You can find some crash logs at case 1240511
     
  2. Carpet_Head

    Carpet_Head

    Joined:
    Nov 27, 2014
    Posts:
    258
    A totally different but equally annoying crash with the Physics.BakeMesh API

    I added a full repro project on Case 1242625