Skip to content

Bevy + Avian3D in a fully headless setup crash #926

@tajo48

Description

@tajo48

I am trying to run Bevy + Avian3D in a fully headless setup (no windowing, no rendering), using MinimalPlugins and ScheduleRunnerPlugin::run_once().

This minimal example compiles and starts, but panics immediately at runtime with a Bevy ECS validation error:

Parameter `...::messages` failed validation: Message not initialized

Full minimal repro:

use avian3d::prelude::*;
use bevy::{app::ScheduleRunnerPlugin, prelude::*};

fn main() {
    App::new()
        .add_plugins(MinimalPlugins.set(ScheduleRunnerPlugin::run_once()))
        .add_plugins((
            TransformPlugin,
            bevy::asset::AssetPlugin::default(),
            bevy::scene::ScenePlugin,
        ))
        .init_resource::<Assets<Mesh>>()
        .add_systems(Update, hello_world_system)
        .add_plugins(PhysicsPlugins::default())
        .run();
}

fn hello_world_system() {
    println!("hello world");
}
[dependencies]
avian3d = "0.5.0"
bevy = "0.18.0"

The panic comes from bevy_ecs complaining about an uninitialized Message parameter (suggesting Option<T> / If<T>), but this happens before I register any Avian-specific systems myself.

Is this a known limitation of Avian in headless / MinimalPlugins setups, or am I missing a required plugin or resource initialization for physics-only use? Any guidance on the minimal plugin set needed for Avian without rendering would be appreciated.

Perhaps related to #505

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions