I managed to make my bot respawn, however there are 3 problems:
The first problem is that it respawns at the slightest click, even though I correctly set it to respawn only after its death, and its death occurs after X number of bullets (this has been verified).
The second is that I can’t make its head respawn.. (X
If I shoot its head, the enemy just disappears. If I shoot its body, it respawns correctly with its head.
And finally, third problem: The respawn is not infinite. Well, it should be, but after 5-6-10 deaths, it eventually stops spawning. Why?
Thank you. I managed to do what I’m showing you in the picture without a tutorial. I’m happy about that, but there are clearly still problems. (X
script ennemy :
‘‘‘if _current_health <= 0.0 and max_health != 0.0:
_die()
else:
ennemy._on_ennemy_respawned()
func _die() → void:
queue_free()
@onreadyonready var ennemy = $“.”
func _on_ennemy_respawned():
self.global_position = Vector3(0.0, 1.28, -23)’’’
Script head :
‘‘‘if _current_health <= 0.0 and max_health != 0.0:
_die()
else:
ennemi._die()
ennemy._on_ennemy_respawned()
func _die() → void:
queue_f@onreadyee()
@onready var e@onreadynemy = $“..”
@onready var tete = $“.”
func _on_ennemy_respawned():
self.global_position = Vector3(0.0, 1.3, -23)’’’
As you can see, I tried, in the head script, to make the enemy respawn entirely instead of just its head, but that doesn’t work either. (X
Update: Problem solved. ^^