Seems more reliable than the original method but not perfect. Added number based weapon switching

This commit is contained in:
derek
2024-10-29 17:00:46 -05:00
parent 00aa8db85d
commit 7c32586348
5 changed files with 62 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ var player_velocity
func _ready():
visible = false
linear_velocity += transform.basis * Vector3(0, 0, -bullet_speed) + player_velocity
linear_velocity += transform.basis * Vector3(0, 0, -bullet_speed)
# Called every frame. 'delta' is the elapsed time since the previous frame.
@@ -31,7 +31,7 @@ func _physics_process(delta):
distance_from_player = abs(self.global_position - player_position)
if distance_from_player.x > 2 or distance_from_player.y > 2 or distance_from_player.z > 2:
if distance_from_player.length() > 1.5:
visible = true