added enemy health bar and target with markers

This commit is contained in:
derek
2025-03-22 19:09:13 -05:00
parent b85014c48b
commit c435db8b67
30 changed files with 239 additions and 33 deletions

21
scripts/target_1.gd Normal file
View File

@@ -0,0 +1,21 @@
extends StaticBody3D
@onready var ray_cast_3d: RayCast3D = $RayCast3D
const TARGET_MARKER = preload("res://assets/target_marker.tscn")
func _ready() -> void:
SignalBus.player_reloading.connect(remove_targets)
func remove_targets():
print("PLAYER RELOADING")
for i in get_children():
if i.is_in_group("target_marker"):
i.queue_free()
func add_marker(collision_point,bullet_rotation):
var instance_marker = TARGET_MARKER.instantiate()
add_child(instance_marker)
instance_marker.global_position = collision_point
instance_marker.global_rotation = bullet_rotation