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,6 +1,8 @@
extends RigidBody3D
class_name Projectile
@export var collision_raycast_3d : RayCast3D
var player_position
var player_velocity
var bullet_active = true
@@ -19,3 +21,9 @@ func _process(delta: float) -> void:
if distance_from_player.length() > 2:
visible = true
func collision_ray():
if collision_raycast_3d != null:
#do looking towards velocity
#do lenghth of distance traveled next frame
pass

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()