Add food dispensers to shop.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user