diff --git a/src/main.rs b/src/main.rs index 22d4de2..4ec3076 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,12 +45,17 @@ fn setup(mut commands: Commands, asset_server: Res) { } #[derive(Component)] +#[relationship(relationship_target = TargetedBerry)] pub struct TargetBerry(pub Entity); +#[derive(Component)] +#[relationship_target(relationship = TargetBerry)] +pub struct TargetedBerry(Entity); + fn find_closest_berry( In(input): In, mut commands: Commands, - berries: Query<(Entity, &Transform), With>, + berries: Query<(Entity, &Transform), (With, Without, Without)>, planner: Query<&Transform, With>, ) -> OperatorStatus { let pos = planner.get(input.entity).unwrap().translation.xy();