in the parent node there is this code:
`var enemy_scene = preload("res://enemy.tscn")
#there is a timer set to five seconds
func _on_timer_timeout():
var enemy = enemy_scene.instantiate()
enemy.position = Vector3(-5, 254, -269)
add_child(enemy)`
in the player script there is this code:
`func _physics_process(delta):
if Input.is_action_pressed("click") and ray_cast_3d.is_colliding():
Global.enemy_health -= 1
func _on_timer_timeout():
Global.enemy_health = 100`
the enemy script has the folowing code:
`func _physics_process(delta):
if Global.enemy_health <= 0:
self.queue_free()`