stride3d/stride · error · NotImplementedException

could not handle ' ', please file an issue or fix this

Error message

{nameof(ICollider.AppendModel)} could not handle '{collider.GetType()}', please file an issue or fix this

What it means

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.

Solutions

  1. 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).
  2. If it is a custom collider, implement the AppendModel path yourself or convert it to a supported primitive/composite (CompoundCollider of supported parts).
  3. Add a switch arm mapping the new collider type in CompoundCollider.cs before the '_' throw.
  4. File an issue with the Stride.BepuPhysics maintainers including the collider type name as the message suggests.

Example fix

// before
var colliderShape = new UnsupportedCollider();
simulation.Collidable.Add(colliderShape); // throws at AppendModel
// after
var colliderShape = new BoxCollider(new Vector3(1f, 1f, 1f));
simulation.Collidable.Add(colliderShape); // supported shape
Defensive patterns

Strategy: validation

Validate before calling

bool isSupported = collider is BoxCollider or CapsuleCollider or CylinderCollider or SphereCollider or TriangleCollider or ConvexHullCollider;
if (!isSupported) throw new NotSupportedException($"{collider.GetType()} is not supported by Stride.BepuPhysics");

Type guard

static bool IsSupportedCollider(ICollider c) => c is BoxCollider or CapsuleCollider or CylinderCollider or SphereCollider or TriangleCollider or ConvexHullCollider;

Try / catch

try { modelBuilder.AppendModel(collider); } catch (NotImplementedException ex) { Logger.Error($"Unsupported collider {collider.GetType()}: {ex.Message}"); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/ea2a85508f076e04. Report an issue: GitHub.

Appendix: source

Thrown at sources/engine/Stride.BepuPhysics/Stride.BepuPhysics/Definitions/Colliders/CompoundCollider.cs:136

        foreach (var collider in _colliders)
            collider.OnDetach(pool);
        shapes.RemoveAndDispose(index, pool);
    }

    void ICollider.AppendModel(List<BasicMeshBuffers> buffer, ShapeCacheSystem shapeCache, out object? cache)
    {
        cache = null;
        foreach (var collider in _colliders)
        {
            buffer.Add(collider switch
            {
                BoxCollider box => shapeCache._boxShapeData,
                CapsuleCollider cap => shapeCache.BuildCapsule(cap),
                CylinderCollider cyl => shapeCache._cylinderShapeData,
                SphereCollider sph => shapeCache._sphereShapeData,
                TriangleCollider tri => shapeCache.BuildTriangle(tri),
                ConvexHullCollider con => shapeCache.BorrowHull(con),
                _ => throw new NotImplementedException($"{nameof(ICollider.AppendModel)} could not handle '{collider.GetType()}', please file an issue or fix this"),
            });
        }
    }

    void ICollider.RayTest<TRayHitHandler>(Shapes shapes, TypedIndex shapeIndex, in NRigidPose pose, in RayData ray, ref float maximumT, ref TRayHitHandler hitHandler, BufferPool pool)
    {
        if (shapeIndex.Type == Compound.TypeId)
        {
            shapes.GetShape<Compound>(shapeIndex.Index).RayTest(pose, in ray, ref maximumT, shapes, pool, ref hitHandler);
        }
        else
        {
            Debug.Assert(shapeIndex.Type == BigCompound.TypeId);
            shapes.GetShape<BigCompound>(shapeIndex.Index).RayTest(pose, in ray, ref maximumT, shapes, pool, ref hitHandler);
        }
    }
}

View on GitHub (pinned to 96fad776d2)