From 144e18b2d0f5eca1a1aefe6334290310d4173313 Mon Sep 17 00:00:00 2001 From: Sara Date: Sat, 19 Jul 2025 20:04:52 +0200 Subject: [PATCH] fix: look_at normal and up aligning --- modules/wave_survival/hitscan_muzzle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/wave_survival/hitscan_muzzle.cpp b/modules/wave_survival/hitscan_muzzle.cpp index 6f89dc8a..de4acd55 100644 --- a/modules/wave_survival/hitscan_muzzle.cpp +++ b/modules/wave_survival/hitscan_muzzle.cpp @@ -39,7 +39,8 @@ void HitscanMuzzle::shoot() { get_tree()->get_current_scene()->add_child(effect); Vector3 const point{ get_collision_point() }; Vector3 const normal{ get_collision_normal() }; - effect->look_at_from_position(point, point + normal); + Vector3 const position{ get_global_position() }; + effect->look_at_from_position(point, point + normal, (point - position).normalized()); } else if (effect_as_node) { effect_as_node->queue_free(); }