Closed
Description
In my particular use case, I would like the ability to be able to use traits in a With<>
or Without<>
filter in the query.
Example:
pub fn cleanup_status(
mut commands: Commands,
q: Query<
Entity,
(
With<PawnStatus<pawn_status::Attacking>>,
Without<dyn work_order::OrderItem>,
),
>,
) {
}
The above return a compile error because
- the size for values of type (dyn OrderItem + 'static) cannot be known at compilation time the trait
Sized
is not implemented for(dyn OrderItem + 'static)
- the trait bound
(dyn OrderItem + 'static): bevy::prelude::Component
is not satisfied
the following other types implement traitbevy::prelude::Component
The definition for OrderItem
is as such:
#[bevy_trait_query::queryable]
pub trait OrderItem {}
Metadata
Metadata
Assignees
Labels
No labels