added enemy health bar and target with markers
This commit is contained in:
21
scripts/target_1.gd
Normal file
21
scripts/target_1.gd
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user