tried and failed to implement player surrounding for enemies

This commit is contained in:
Derek
2024-07-21 15:22:43 -05:00
parent 58cf16ec41
commit a7b8613329
5 changed files with 10 additions and 6 deletions

View File

@@ -77,14 +77,16 @@ func _process(delta):
distance_to_player = abs(self.global_position - player.global_position)
if distance_to_player.x > 4 or distance_to_player.z > 4:
move_and_slide()
#if distance_to_player.x > 4 or distance_to_player.z > 4:
move_and_slide()
func _on_area_3d_body_part_hit(dam,bullet_damage):
health -= dam * bullet_damage
print("health: " + str(health))
if health <= 0:
#remove from parent array
get_parent().minions.erase(self)
particlespawn = die_particles.instantiate()
particlespawn.position = self.global_position