tweaks to projectile script

This commit is contained in:
Derek
2025-03-24 08:40:29 -05:00
parent 077e6b4bb9
commit 2e7cc249ae
6 changed files with 56 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
extends StaticBody3D
@export var remove_targets_on_reload = false
@onready var ray_cast_3d: RayCast3D = $RayCast3D
const TARGET_MARKER = preload("res://assets/target_marker.tscn")
@@ -8,10 +9,10 @@ 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()
if remove_targets_on_reload:
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()