Files
HEDZReloaded/crates/hedz_reloaded/src/utils/one_shot_force.rs
extrawurst 7cfae285ed Crate unification (#88)
* move client/server/config into shared

* move platforms into shared

* move head drops into shared

* move tb_entities to shared

* reduce server to just a call into shared

* get solo play working

* fix server opening window

* fix fmt

* extracted a few more modules from client

* near completely migrated client

* fixed duplicate CharacterInputEnabled definition

* simplify a few things related to builds

* more simplifications

* fix warnings/check

* ci update

* address comments

* try fixing macos steam build

* address comments

* address comments

* CI tweaks with default client feature

---------

Co-authored-by: PROMETHIA-27 <electriccobras@gmail.com>
2025-12-18 12:31:22 -05:00

20 lines
513 B
Rust

use avian3d::prelude::{Forces, RigidBodyForces};
use bevy::prelude::*;
pub fn plugin(app: &mut App) {
app.add_systems(FixedUpdate, apply_one_shot_forces);
}
#[derive(Component)]
pub struct OneShotImpulse(pub Vec3);
pub fn apply_one_shot_forces(
mut commands: Commands,
mut query: Query<(Entity, &OneShotImpulse, Forces)>,
) {
for (entity, force, mut forces) in query.iter_mut() {
forces.apply_linear_impulse(force.0);
commands.entity(entity).remove::<OneShotImpulse>();
}
}