tweaks to projectile script
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user