{"record":{"id":"ea2a85508f076e04","repo":"stride3d/stride","slug":"nameof-icollider-appendmodel-could-not-handle-collider","errorCode":null,"errorMessage":"{nameof(ICollider.AppendModel)} could not handle '{collider.GetType()}', please file an issue or fix this","messagePattern":"(.+?) could not handle '(.+?)', please file an issue or fix this","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.BepuPhysics/Stride.BepuPhysics/Definitions/Colliders/CompoundCollider.cs","lineNumber":136,"sourceCode":"        foreach (var collider in _colliders)\n            collider.OnDetach(pool);\n        shapes.RemoveAndDispose(index, pool);\n    }\n\n    void ICollider.AppendModel(List<BasicMeshBuffers> buffer, ShapeCacheSystem shapeCache, out object? cache)\n    {\n        cache = null;\n        foreach (var collider in _colliders)\n        {\n            buffer.Add(collider switch\n            {\n                BoxCollider box => shapeCache._boxShapeData,\n                CapsuleCollider cap => shapeCache.BuildCapsule(cap),\n                CylinderCollider cyl => shapeCache._cylinderShapeData,\n                SphereCollider sph => shapeCache._sphereShapeData,\n                TriangleCollider tri => shapeCache.BuildTriangle(tri),\n                ConvexHullCollider con => shapeCache.BorrowHull(con),\n                _ => throw new NotImplementedException($\"{nameof(ICollider.AppendModel)} could not handle '{collider.GetType()}', please file an issue or fix this\"),\n            });\n        }\n    }\n\n    void ICollider.RayTest<TRayHitHandler>(Shapes shapes, TypedIndex shapeIndex, in NRigidPose pose, in RayData ray, ref float maximumT, ref TRayHitHandler hitHandler, BufferPool pool)\n    {\n        if (shapeIndex.Type == Compound.TypeId)\n        {\n            shapes.GetShape<Compound>(shapeIndex.Index).RayTest(pose, in ray, ref maximumT, shapes, pool, ref hitHandler);\n        }\n        else\n        {\n            Debug.Assert(shapeIndex.Type == BigCompound.TypeId);\n            shapes.GetShape<BigCompound>(shapeIndex.Index).RayTest(pose, in ray, ref maximumT, shapes, pool, ref hitHandler);\n        }\n    }\n}\n","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.BepuPhysics/Stride.BepuPhysics/Definitions/Colliders/CompoundCollider.cs#L118-L154","documentation":"CompoundColliderShapeData (implementing ICollider.AppendModel) cannot build a Bepu physics shape model for the given collider type. The switch over collider types has no arm for the type encountered, so the library treats it as a bug and asks you to file an issue. It signals an unsupported collider kind reaching the physics shape compilation step.","triggerScenarios":"Adding a collider component whose concrete type (e.g. a custom ICollider implementation or a collider type not yet mapped such as a new MeshCollider variant) is dispatched to the catch-all '_' arm of the switch in AppendModel while the physics engine builds its shape model.","commonSituations":"Custom collider types derived from ICollider/ColliderComponent that Bepu integration does not know about; a newly added Stride collider kind used before Stride.BepuPhysics added support; mismatched package versions where a collider type exists but its Bepu mapping is missing.","solutions":["Check which collider type appears in the message and confirm Stride.BepuPhysics supports it; replace it with a supported one (Box, Capsule, Cylinder, Sphere, Triangle, ConvexHull).","If it is a custom collider, implement the AppendModel path yourself or convert it to a supported primitive/composite (CompoundCollider of supported parts).","Add a switch arm mapping the new collider type in CompoundCollider.cs before the '_' throw.","File an issue with the Stride.BepuPhysics maintainers including the collider type name as the message suggests."],"exampleFix":"// before\nvar colliderShape = new UnsupportedCollider();\nsimulation.Collidable.Add(colliderShape); // throws at AppendModel\n// after\nvar colliderShape = new BoxCollider(new Vector3(1f, 1f, 1f));\nsimulation.Collidable.Add(colliderShape); // supported shape","handlingStrategy":"validation","validationCode":"bool isSupported = collider is BoxCollider or CapsuleCollider or CylinderCollider or SphereCollider or TriangleCollider or ConvexHullCollider;\nif (!isSupported) throw new NotSupportedException($\"{collider.GetType()} is not supported by Stride.BepuPhysics\");","typeGuard":"static bool IsSupportedCollider(ICollider c) => c is BoxCollider or CapsuleCollider or CylinderCollider or SphereCollider or TriangleCollider or ConvexHullCollider;","tryCatchPattern":"try { modelBuilder.AppendModel(collider); } catch (NotImplementedException ex) { Logger.Error($\"Unsupported collider {collider.GetType()}: {ex.Message}\"); }","preventionTips":["Only use collider types listed as supported in Stride.BepuPhysics docs","Never implement custom ICollider types without adding an AppendModel switch arm","Keep Stride and Stride.BepuPhysics package versions aligned","Report missing collider mappings upstream as the message requests"],"tags":["physics","collision","unsupported-type"],"backgroundTag":"unsupported-operation","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}