#Is this this component struct also a bundle?

3 messages · Page 1 of 1 (latest)

midnight owl
#
/// Component representing impassable terrain.
#[derive(Component, Clone, Copy, Default)]
pub struct ImpassableTerrain {
    /// Marker component: Impassable terrain is pathfinding impassable
    pub impassable: Impassable,
}

#[derive(Component, Clone, Copy, Default)]
pub struct Impassable;

Suppose I have something like commands.spawn(ImpassableTerrain { impassable: Impassable }), would you expect this entity to show up in queries of type Query<Entity, With<Impassable>>?

#

I think the answer is "no"

#

I think I have to still derive "Bundle" on ImpassableTerrain, not "Component"?