Getting a the trait " WorldQuery
is not implemented for enemy::Enemy
" when trying to query
#9059
-
Hey so i'm trying to use bevy made a small prototype of the enemy class. it worked fine until i decided to split the Enemy struct code into separate files. There were no major changes done to the code, just add the pub keyword where necessary and importing the stuff.
I tried to revert the changes but that didn't seem to work as well. What am i doing wrong? #[derive(Component, Clone)]
pub struct Enemy {
id: Uuid,
position: Vec3,
color: Color,
size: Vec2,
health: u32,
speed: f32,
dir: Vec3,
goto: Vec3,
point_no: usize,
} I googled the error and got this, but it didnt seem to help. Bevy Version: 0.10.1 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It should be |
Beta Was this translation helpful? Give feedback.
It should be
mut enemy_q:Query<(Entity,&Enemy)>
(note the&
beforeEnemy
, also note thatEntity
is the only type to not require a&
).