multyplayer

This commit is contained in:
algodoogle
2026-07-16 18:36:49 +01:00
parent 5e0b58a984
commit 1869dbf054
28 changed files with 974 additions and 60 deletions
+6 -6
View File
@@ -13,10 +13,10 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
# Only the world owner dispenses, so every client doesn't spawn its own copy.
if not NetworkManager.owns_world():
return
if not snap_zone.picked_up_object:
var new_item = item_scene.instantiate()
# Add the new item to the hob's parent (so it lives in the main world space)
get_parent().add_child(new_item)
new_item.global_transform = snap_zone.transform
snap_zone.pick_up_object(new_item)
var new_item := NetworkManager.spawn_item(item_scene.resource_path, snap_zone.global_transform)
if new_item:
snap_zone.pick_up_object(new_item)