Fix despawning items not blinking

This commit is contained in:
JonShard
2026-08-16 10:35:20 +02:00
parent 1a7f641974
commit 4a8d5b879e
2 changed files with 2 additions and 6 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ func _ready() -> void:
# Configure Multiplayer Synchronizer
# This overwrites any changes made in the inspector.
replication_config = SceneReplicationConfig.new()
var properties: Array[NodePath] = [".:position", ".:quaternion", ".:enabled"]
var properties: Array[NodePath] = [".:position", ".:quaternion", ".:enabled", ".:visible"]
for property_path in properties:
replication_config.add_property(property_path)
replication_config.property_set_replication_mode(property_path, SceneReplicationConfig.REPLICATION_MODE_ALWAYS)
+1 -5
View File
@@ -58,11 +58,7 @@ func _process(delta: float) -> void:
_set_visible(int(_time_left * 5.0) % 2 == 0)
# `visible` is not a replicated property, so a blink driven only here would make
# the item flicker on the host and stay solid on clients. Until it is synced,
# only warn when there is nobody else to disagree with.
func _set_visible(value: bool) -> void:
if NetworkManager.is_online():
get_parent().visible = true
if not NetworkManager.owns_world():
return
get_parent().visible = value