From 74e68bcca1ee7ba8f51999672e2c8e4fb2e8bef0 Mon Sep 17 00:00:00 2001 From: Sara Date: Wed, 24 Jun 2026 13:16:19 +0200 Subject: [PATCH] fix: projectiles spawn in level subscene --- modules/viscosity/enemy_orb.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/viscosity/enemy_orb.cpp b/modules/viscosity/enemy_orb.cpp index cafd8398..96f9a8fc 100644 --- a/modules/viscosity/enemy_orb.cpp +++ b/modules/viscosity/enemy_orb.cpp @@ -25,9 +25,9 @@ void EnemyOrb::shoot() { } get_tree()->create_timer(this->shoot_delay)->connect("timeout", callable_mp(this, &EnemyOrb::shoot)); Node3D *inst{ cast_to(this->projectile->instantiate()) }; - inst->set_position(get_global_position()); - inst->set_rotation(get_global_rotation()); - get_tree()->get_current_scene()->add_child(inst); + inst->set_position(get_position()); + inst->set_rotation(get_rotation()); + get_parent()->add_child(inst); } void EnemyOrb::body_entered(Node3D *body) {