This commit is contained in:
algodoogle
2026-07-16 22:23:33 +01:00
parent 1869dbf054
commit 4e6c645938
6 changed files with 91 additions and 12 deletions
+11
View File
@@ -24,6 +24,17 @@ func _ready() -> void:
_apply_authority_state()
## Enable the item only where it is free or where we are its current holder, so
## a peer's snap zone / hand never grabs an item another peer is holding. Called
## by NetworkManager whenever net_held_by changes. Note: net_held_by is set per
## peer by RPC (not by a synchronizer), so the holder keeps its item enabled
## while everyone else disables their copy.
func apply_held_state() -> void:
if not _item:
return
_item.enabled = net_held_by == 0 or net_held_by == multiplayer.get_unique_id()
func _physics_process(_delta: float) -> void:
if not NetworkManager.is_online():
return