fix: look_at normal and up aligning

This commit is contained in:
Sara 2025-07-19 20:04:52 +02:00
parent f02dbf44ac
commit 144e18b2d0

View file

@ -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();
}