We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 303ecf5 commit 55ab7efCopy full SHA for 55ab7ef
crates/hyperion/src/lib.rs
@@ -356,9 +356,24 @@ impl Hyperion {
356
357
world
358
.component::<Player>()
359
- .add_trait::<(flecs::With, EntitySize)>()
360
- .add_trait::<(flecs::With, Yaw)>()
361
- .add_trait::<(flecs::With, Pitch)>();
+ .add_trait::<(flecs::With, EntitySize)>();
+
+ // add yaw and pitch
362
+ world
363
+ .observer::<flecs::OnAdd, ()>()
364
+ .with::<Player>()
365
+ .without::<Yaw>()
366
+ .each_entity(|entity, ()| {
367
+ entity.set(Yaw::default());
368
+ });
369
370
371
372
373
+ .without::<Pitch>()
374
375
+ entity.set(Pitch::default());
376
377
378
world.set(IgnMap::default());
379
0 commit comments