fix: projectiles spawn in level subscene

This commit is contained in:
Sara Gerretsen 2026-06-24 13:16:19 +02:00
parent e6c932c24f
commit 74e68bcca1

View file

@ -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<Node3D>(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) {