Attention: Here be dragons
This is the
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Synchronizes properties from the multiplayer authority to the remote peers.
By default, MultiplayerSynchronizer synchronizes configured properties to all peers.
Visibility can be handled directly with set_visibility_for or as-needed with add_visibility_filter and update_visibility.
MultiplayerSpawners will handle nodes according to visibility of synchronizers as long as the node at root_path was spawned by one.
Internally, MultiplayerSynchronizer uses MultiplayerAPI.object_configuration_add to notify synchronization start passing the Node at root_path as the
object and itself as the
configuration, and uses MultiplayerAPI.object_configuration_remove to notify synchronization end in a similar way.
add_visibility_filter ( Callable filter )
get_visibility_for ( int peer ) const
remove_visibility_filter ( Callable filter )
set_visibility_for ( int peer, bool visible )
update_visibility ( int for_peer=0 )
synchronized ( )
Emitted when a new synchronization state is received by this synchronizer after the variables have been updated.
visibility_changed ( int for_peer )
Emitted when visibility of
for_peer is updated. See update_visibility.
VisibilityUpdateMode VISIBILITY_PROCESS_IDLE =
Visibility filters are updated every idle process frame.
VisibilityUpdateMode VISIBILITY_PROCESS_PHYSICS =
Visibility filters are updated every physics process frame.
VisibilityUpdateMode VISIBILITY_PROCESS_NONE =
Visibility filters are not updated automatically, and must be updated manually by calling update_visibility.
bool public_visibility =
Whether synchronization should be visible to all peers by default. See set_visibility_for and add_visibility_filter for ways of configuring fine-grained visibility options.
void set_replication_config ( SceneReplicationConfig value )
SceneReplicationConfig get_replication_config ( )
Resource containing which properties to synchronize.
float replication_interval =
Time interval between synchronizes. When set to
0.0 (the default), synchronizes happen every network process frame.
NodePath root_path =
Node path that replicated properties are relative to.
If root_path was spawned by a MultiplayerSpawner, the node will be also be spawned and despawned based on this synchronizer visibility options.
VisibilityUpdateMode visibility_update_mode =
void set_visibility_update_mode ( VisibilityUpdateMode value )
VisibilityUpdateMode get_visibility_update_mode ( )
Specifies when visibility filters are updated (see VisibilityUpdateMode for options).
void add_visibility_filter ( Callable filter )
Adds a peer visibility filter for this synchronizer.
filter should take a peer ID int and return a bool.
bool get_visibility_for ( int peer ) const
Queries the current visibility for peer
void remove_visibility_filter ( Callable filter )
Removes a peer visibility filter from this synchronizer.
void set_visibility_for ( int peer, bool visible )
Sets the visibility of
0, the value of public_visibility will be updated instead.
void update_visibility ( int for_peer=0 )
Updates the visibility of
peer according to visibility filters. If
0 (the default), all peers' visibilties are updated.