stride3d/stride · error · Exception
ContinuousCollisionDetection must be enabled at physics…
Error message
ContinuousCollisionDetection must be enabled at physics engine initialization using the proper flag.
What it means
The ContinuousCollisionDetection getter on Stride's Simulation only works if the underlying physics engine (Bullet) was initialized with the CCD flag. If CanCcd is false (PhysicsEngineFlags.ContinuousCollisionDetection not set in the configuration), reading the property throws because the feature is unavailable in this simulation instance.
Solutions
- Set PhysicsEngineFlags.ContinuousCollisionDetection in the PhysicsConfiguration flags BEFORE the physics engine/Simulation is created
- Check CanCcd before accessing the property and skip CCD configuration if unavailable
- Reconfigure the physics engine initialization code (e.g. in the scene's physics settings or Simulation creation) and restart the application
Example fix
// before
var simulation = this.GetSimulation();
simulation.ContinuousCollisionDetection = true; // throws if flag unset
// after
var config = new PhysicsConfiguration { Flags = PhysicsEngineFlags.ContinuousCollisionDetection };
var simulation = new Simulation(this, config);
simulation.ContinuousCollisionDetection = true; Defensive patterns
Strategy: validation
Validate before calling
if (simulation.CanCcd)
{
var ccd = simulation.ContinuousCollisionDetection;
}
else
{
// CCD not enabled at initialization
} Try / catch
try
{
var ccd = simulation.ContinuousCollisionDetection;
}
catch (Exception ex) when (ex.Message.Contains("ContinuousCollisionDetection"))
{
// fall back: CCD unavailable, use smaller timestep
} Prevention
- Set PhysicsEngineFlags.ContinuousCollisionDetection in PhysicsConfiguration flags at engine initialization if you plan to use CCD
- Check CanCcd before touching any CCD-related API
- Centralize physics configuration in one place so required flags are documented and consistently applied
When it happens
Trigger: Reading the Simulation.ContinuousCollisionDetection property when the Simulation was created with a PhysicsConfiguration whose Flags do not include PhysicsEngineFlags.ContinuousCollisionDetection.
Common situations: Enabling CCD in a game component or script at runtime without having set the flag at engine initialization; default project templates that don't pass the CCD flag to the physics engine.
Related errors
- A Gear constraint always needs two rigidbodies to be…
- A Gear constraint requires two rigidbodies.
- AfterUpdate cannot be called out of the micro-thread…
- All should have hashsets associated to them
- ArgumentNullException: data
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/980c492bffa75ffb.
Report an issue: GitHub.
Appendix: source
Thrown at sources/engine/Stride.Physics/Simulation.cs:52
private readonly BulletSharp.DispatcherInfo dispatchInfo;
private SimulationTickEvent preSimulationTick, postSimulationTick;
internal readonly bool CanCcd;
private float carriedDelta;
#if DEBUG
private static readonly Logger Log = GlobalLogger.GetLogger(typeof(Simulation).FullName);
#endif
public bool ContinuousCollisionDetection
{
get
{
if (!CanCcd)
{
throw new Exception("ContinuousCollisionDetection must be enabled at physics engine initialization using the proper flag.");
}
return dispatchInfo.UseContinuous;
}
set
{
if (!CanCcd)
{
throw new Exception("ContinuousCollisionDetection must be enabled at physics engine initialization using the proper flag.");
}
dispatchInfo.UseContinuous = value;
}
}
/// <summary>
/// Totally disable the simulation if set to true
/// </summary>View on GitHub (pinned to 96fad776d2)