tried and failed to implement player surrounding for enemies
This commit is contained in:
@@ -591,7 +591,6 @@ bullet = ExtResource("2_aew5r")
|
||||
casing = ExtResource("3_6esjv")
|
||||
bullet_speed = 75
|
||||
bullet_drop = 0.01
|
||||
bullet_damage = 0
|
||||
|
||||
[node name="TurretLook" type="RayCast3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00161432, 1.62046, 0.00134204)
|
||||
|
||||
@@ -32,6 +32,7 @@ glow_enabled = true
|
||||
glow_intensity = 3.32
|
||||
glow_bloom = 0.07
|
||||
volumetric_fog_density = 0.01
|
||||
adjustment_contrast = 1.5
|
||||
|
||||
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_svyyv"]
|
||||
dof_blur_near_enabled = true
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -14,8 +14,10 @@ func _ready():
|
||||
func _process(delta):
|
||||
for i in minions:
|
||||
number_minions = minions.size()
|
||||
rot_amount = 360 / number_minions
|
||||
rot_amount = deg_to_rad(360 / number_minions)
|
||||
i.nav_agent.set_target_position(i.player.global_transform.origin)
|
||||
var next_nav_point = i.nav_agent.get_next_path_position()
|
||||
#var next_nav_point
|
||||
#next_nav_point_start.rotate += rot_amount #times index
|
||||
|
||||
i.hive_velocity = (next_nav_point - i.global_transform.origin).normalized() * i.SPEED
|
||||
|
||||
@@ -77,7 +77,7 @@ 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:
|
||||
#if distance_to_player.x > 4 or distance_to_player.z > 4:
|
||||
move_and_slide()
|
||||
|
||||
|
||||
@@ -85,6 +85,8 @@ 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