fix bug
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user