started fixing hud to prevent crosshair from wobbling
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user