pickup item values are assigned through level editor and spawn correctly, now need to implement non random spawns

This commit is contained in:
Derek
2025-01-16 23:09:57 -06:00
parent 0a3bdd26d4
commit cafcf57ef1
7 changed files with 53 additions and 28 deletions

View File

@@ -6,18 +6,16 @@ extends Node3D
@onready var anim_player = $AnimationPlayer
@onready var vend_ray = $VendRay
@onready var label_3d = $Label3D
@onready var level_control = get_tree().current_scene
var active = true
var level_control
# Called when the node enters the scene tree for the first time.
func _ready():
level_control = get_tree().current_scene
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
if active == true:
label_3d.text = str(item_price)
else:
label_3d.text = "offline"
func interact():
if active == true:
@@ -39,3 +37,17 @@ func vend():
active = false
label_3d.text = "offline"
get_parent().add_child(item_vend)
func save():
var save_dict = {
"filename" : get_scene_file_path(),
"parent" : get_parent().get_path(),
"pos_x" : position.x,
"pos_y" : position.y,
"pos_z" : position.z,
"rot_x" : rotation.x,
"rot_y" : rotation.y,
"rot_z" : rotation.z,
"active" : active
}
return save_dict