# ArgumentException: Index buffer format is not supported for this mesh topology. Use 16-bit indices or change topology to triangles.

- **ID:** `unity/argumentexception-mesh-indexbuffer-format`
- **Domain:** unity
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A mesh with 32-bit index format is being used with a non-triangle topology (e.g., lines, points) which only supports 16-bit indices in Unity.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Unity 2022.3.15f1 | active | — | — |
| Unity 2023.2.0a18 | active | — | — |
| Unity 2021.3.35f1 | active | — | — |

## Workarounds

1. **Change the mesh topology to triangles (MeshTopology.Triangles) in your script before assigning indices, or ensure the mesh asset is imported with triangle topology.** (85% success)
   ```
   Change the mesh topology to triangles (MeshTopology.Triangles) in your script before assigning indices, or ensure the mesh asset is imported with triangle topology.
   ```
2. **If you must use lines or points, ensure vertex count is below 65535 so 16-bit indices suffice. Set mesh.indexFormat = IndexFormat.UInt16 and rebuild the mesh.** (75% success)
   ```
   If you must use lines or points, ensure vertex count is below 65535 so 16-bit indices suffice. Set mesh.indexFormat = IndexFormat.UInt16 and rebuild the mesh.
   ```

## Dead Ends

- **** — The error occurs because 32-bit indices are not allowed for non-triangle topologies; forcing UInt32 doesn't fix topology incompatibility. (90% fail)
- **** — Compression affects vertex data, not index format or topology. (95% fail)
- **** — Skinned mesh renderers also use the same index format constraints. (80% fail)
