Unity Issue Tracker - Mesh.GetIndexBuffer() requires Mesh's 'Read/Write' flag to be enabled to get its index buffer data in Builds
Closed
UUM-6988
Mesh.GetIndexBuffer() requires Mesh's 'Read/Write' flag to be enabled to get its index buffer data in Builds
Unity: Mesh
Won't Fix
2023.2.X
2023.1.X
2022.2.X
2022.1.X
2021.3.X
2022.1 has reached end of life so the issue will be fixed in a newer version.
Reproduction steps:
1. Open the attached 'GetIndexBuffer' project
2. Open the 'SampleScene'
3. Observe the 'Assets\Body mesh.fbx' model in the Inspector
4. In the 'Model' section toggle off the 'Read/Write' checkbox
5. Go to the 'File -> Build and Run'
6. In the build click on the 'Open Log File'
Expected result: 'GPU GetIndexBuffer (GraphicsBuffer) = 5904' is logged, index buffer data is accessible
Actual result: 'GPU GetIndexBuffer (GraphicsBuffer) = 0' is logged, no index buffer data can be retrieved
Reproducible with: 2021.3.5f1, 2022.1.5f1, 2022.2.0a17, 2023.1.0a1
Could not test with: 2020.3.35f1 (Compile errors)
Note:
The issue is not reproducible in the Editor
Prioritise and Follow this issue
Have a workaround or additional info about this issue?