Search Issue Tracker
Won't Fix
Votes
0
Found in
2020.3.23f1
2023.1.0a5
Issue ID
UUM-12007
Regression
No
[Mesh] Cylinder and Sphere meshes disappear until editor restart after modifying index buffer in playmode
*Steps*
# Open project (see comments)
# Open Assets/LOW/BreaksResourcesRepro
# Check scene view
## Observe that Cylinders and spheres are visible
# Enter playmode
# Exit playmode
# Check scene view
{*}Expected{*}: Cylinders and Spheres are still visible
{*}Actual{*}: Cylinders and Spheres are no longer visibile
Repro: 2020.3.23f1, 2023.1.0a5
{*}Notes{*}:
- fixed after editor restart
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Build fails with compiler errors when switching scripts GUIDs
- Many references for Animator elements redirect to missing pages
- User gets "EndLayoutGroup: BeginLayoutGroup must be called first." error during Xcode selection canceling
- "Unable to use a named GUIStyle without a current skin" error appears in the Console when entering the Play Mode in a project with specific layout
- [D3D12][XR] SRP Foveation foveated rendering on Windows platform not working when Graphics API is set to D3D12
Resolution Note:
The code changes the index buffer format on built-in resources. As described in documentation this clears the index buffer and resets submesh count to 1. This persists even outside of playmode because the GPU data was cleared. Between entering and exiting playmode the GPU data is not re-uploaded. This would put a big burden on entering playmode. Restarting the editor fixes the problem as the meshes are loaded from disk again and the buffers are uploaded to GPU.
In this case I'd advice creating a copy of the original and modify that as desired. Or you need to restore the things that are cleared by changing the index format (set the submeshes up again and fill the index buffer). Note that also in a similar way you could change the vertex positions inside the buffer on the GPU. Those changes will persist across playmode too.
related documentation:
https://docs.unity3d.com/ScriptReference/Rendering.IndexFormat.html
https://docs.unity3d.com/ScriptReference/MeshFilter-sharedMesh.html
https://docs.unity3d.com/ScriptReference/MeshFilter-mesh.html