Search Unity

Dynamic Mesh in 2017 vs 2018 issues

Discussion in 'Editor & General Support' started by KnuckleCracker, Sep 27, 2018.

  1. KnuckleCracker

    KnuckleCracker

    Joined:
    Dec 27, 2011
    Posts:
    81
    So I was on the 2017 LTS build and all was right with the world. I have a simple class used for range indicating that dynamically sets its vertices, uvs, and triangles. It did the usual mesh.clear, mesh.vertices = vertices, etc.

    The refresh of the mesh was called from LateUpdate and in unity 2017 everything worked as expected. When I gave unity 2018.2.9 a shot the other day, things didn't work so well. It seems as if reassigning vertices (increasing the vertex and triangle count) didn't actually work. If the mesh started with a lot of vertices, I could lower the count but it wouldn't increase if it started with a lower amount. In 2018.2.9 if I changed from doing the refresh in LateUpdate to Update, it started working properly again. Odd, but it was a workaround I could live with (with eyebrow raised of course).

    So I give 2018.2.10 a shot wondering if that changed things. It does.... now doing the refresh in Update doesn't work either. Btw, doesn't matter if I call mesh.Clear(false) or not. And again, everything worked fine in unity 2017.

    So I'm either missing something super obvious, or this is perhaps something that just showed up in 2018.2.9 (I dunno, 2018.2.9 is the first 2018 I've tried) and I'm just really unlucky, or something about how to do dynamic meshing has changed and I missed the memo.