tried and failed to implement player surrounding for enemies
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user