Godot Version
v4.4.1.stable.official
Question
I’ve setup a multiplayer game in accordance to Multiplayer in Godot 4.0: Scene Replication – Godot Engine and have Heroes that are spawned in with a MultiplayerSpawner and where they each have a MultiplayerSynchronizer which syncs properties: Hero:position
, Hero:rotation
and HealthComponent:health
. All properties syncs fine between all peers except for the health which only syncs sometimes. It seems like certain updates to the health “triggers” an update while others does not, can this be the case?
I’ve noticed the following:
-
If the hero step in lava and the server calls the heroes damage method, then the health will not be synced:
func damage(dmg: float): health_component.damage(dmg)
-
If the hero takes a constant damage in its processed method, then all health updates gets synced (including lava damage mentioned above):
func _process(delta: float): damage(delta)
Attached is the tree for heroes: