aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--rust/src/basic_die.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/rust/src/basic_die.rs b/rust/src/basic_die.rs
index ab53720..2a61197 100644
--- a/rust/src/basic_die.rs
+++ b/rust/src/basic_die.rs
@@ -219,6 +219,7 @@ impl BasicDie {
if save_event.is_action_released(GodotString::from_str(&self.action_shooting), false) {
self.input_state = InputState::Moving;
self.shoot();
+ self.current_force = 0.0;
return;
}
@@ -294,7 +295,7 @@ impl BasicDie {
None => { godot_warn!("No camera assigned!"); return; },
Some(cam) => {
// get the forward vector of the camera setting the up angle to the defined value in the editor
- let mut forward_vector = -cam.assume_safe().global_transform().basis.c();
+ let mut forward_vector = -cam.assume_safe().global_transform().basis.c().normalized();
forward_vector.y = self.up_angle;
// calculate the impulse force