started fixing hud to prevent crosshair from wobbling

This commit is contained in:
Derek
2025-03-18 08:35:10 -05:00
parent 99cfc9dde2
commit d17bc56ca2
12 changed files with 148 additions and 113 deletions

View File

@@ -3,6 +3,7 @@ class_name Chest
@export var weapon_drops : Array[Resource]
@export var health : float = 30
@export var outline_meshes : Array[MeshInstance3D]
@onready var serial_label: Label3D = $chest_lid/serial_number
var serial_number
@@ -29,9 +30,15 @@ func _process(delta: float) -> void:
func hit(dam):
health -= dam
if !open and health <= 0:
anim_player.play("open")
open = true
open_chest()
func open_chest():
anim_player.play("open")
if outline_meshes != null:
for i in outline_meshes:
i.visible = false
open = true
func spawn_drop():
drop_weapon.position = item_spawn.global_position
drop_weapon.transform.basis = item_spawn.global_transform.basis