Show network Ping & start AI behaviour tree
This commit is contained in:
@@ -2,9 +2,20 @@ extends Node
|
||||
class_name Hitable
|
||||
|
||||
var health = 200
|
||||
var enemies_in_range = []
|
||||
|
||||
func Hit(dmg):
|
||||
#var tween = create_tween()
|
||||
health -= dmg
|
||||
if(health <= 0):
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_area_3d_body_entered(body):
|
||||
if body.get_collision_layer() == 10:
|
||||
enemies_in_range.append(body)
|
||||
|
||||
|
||||
func _on_area_3d_body_exited(body):
|
||||
if body.get_collision_layer() == 10:
|
||||
enemies_in_range.erase(body)
|
||||
|
||||
Reference in New Issue
Block a user