Add food dispensers to shop.

This commit is contained in:
JonShard
2026-08-05 09:46:19 +02:00
parent c7840d3cc7
commit 3646992e35
43 changed files with 629 additions and 453 deletions
+8 -2
View File
@@ -3,7 +3,6 @@ extends StaticBody3D
@export var item_scene : PackedScene
@onready var snap_zone: XRToolsSnapZone = $XRToolsSnapZone
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
if not item_scene:
push_error("Item dispenser is missing a reference to it's item to dispense")
@@ -11,10 +10,17 @@ func _ready() -> void:
push_error("Item dispenser is missing a reference to its snap zone child")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if not NetworkManager.owns_world():
return
#if snap_zone.picked_up_object: # Player picked up this station
#if visible:
#snap_zone.picked_up_object.enabled = true
#else:
#snap_zone.picked_up_object.enabled = false
#return
#
if not snap_zone.picked_up_object:
print("Item dispenser is missing item, spawning new item")
var new_item = NetworkManager.spawn_item(item_scene.resource_path, snap_zone.global_transform)
snap_zone.pick_up_object(new_item)