fix: projectiles spawn in level subscene
This commit is contained in:
parent
e6c932c24f
commit
74e68bcca1
1 changed files with 3 additions and 3 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue