johanhelsing / bevy_trauma_shake

A Bevy plugin for shaking 2d cameras
Apache License 2.0
14 stars 6 forks source link

Compatibility with bevy_rapier2d #7

Open Jokler opened 2 months ago

Jokler commented 2 months ago

This panics right away, is there some way to order the plugins to resolve this?

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins((
            RapierPhysicsPlugin::<NoUserData>::pixels_per_meter(100.0),
            TraumaPlugin,
        ))
        .run();
}
thread 'main' panicked at /home/jokler/.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.14.0/src/schedule/schedule.rs:383:33:

Error when initializing schedule PostUpdate: Tried to order against
`SystemTypeSet(
fn FunctionSystem<fn(
  ParamSet<(
    Query<(Transform, &mut GlobalTransform), (Or<(Changed<Transform>, Added<GlobalTransform>)>, Without<Parent>, Without<Children>)>,
    Query<(Ref<Transform>, &mut GlobalTransform), (Without<Parent>, Without<Children>)>
  )>,
  RemovedComponents<Parent>
),
sync_simple_transforms>()
)`
in a schedule that has more than one
`SystemTypeSet(
  fn FunctionSystem<fn(
    ParamSet<(
    Query<(Transform, &mut GlobalTransform), (Or<(Changed<Transform>, Added<GlobalTransform>)>, Without<Parent>, Without<Children>)>,
    Query<(Ref<Transform>, &mut GlobalTransform), (Without<Parent>, Without<Children>)>
    )>,
    RemovedComponents<Parent>
  ),
  sync_simple_transforms>()
)`
instance.

`SystemTypeSet(
  fn FunctionSystem<fn(
    ParamSet<(
      Query<(Transform, &mut GlobalTransform), (Or<(Changed<Transform>, Added<GlobalTransform>)>, Without<Parent>, Without<Children>)>,
      Query<(Ref<Transform>, &mut GlobalTransform), (Without<Parent>, Without<Children>)>
    )>,
    RemovedComponents<Parent>
  ),
  sync_simple_transforms>()
)`
is a `SystemTypeSet` and cannot be used for ordering if ambiguous. Use a different set without this restriction.
jamessizeland commented 2 weeks ago

Opened PR, I think I've found the fix. https://github.com/johanhelsing/bevy_trauma_shake/pull/9

Jokler commented 5 days ago

To be clear, #9 fixed it for me too.