Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

SceneReplicationConfig

Inherits: Resource < RefCounted < Object

Configuration for properties to synchronize with a MultiplayerSynchronizer.

Methods

void

add_property ( NodePath path, int index=-1 )

NodePath[]

get_properties ( ) const

bool

has_property ( NodePath path ) const

int

property_get_index ( NodePath path ) const

ReplicationMode

property_get_replication_mode ( NodePath path )

bool

property_get_spawn ( NodePath path )

bool

property_get_sync ( NodePath path )

bool

property_get_watch ( NodePath path )

void

property_set_replication_mode ( NodePath path, ReplicationMode mode )

void

property_set_spawn ( NodePath path, bool enabled )

void

property_set_sync ( NodePath path, bool enabled )

void

property_set_watch ( NodePath path, bool enabled )

void

remove_property ( NodePath path )


Enumerations

enum ReplicationMode:

ReplicationMode REPLICATION_MODE_NEVER = 0

Do not keep the given property synchronized.

ReplicationMode REPLICATION_MODE_ALWAYS = 1

Replicate the given property on process by constantly sending updates using unreliable transfer mode.

ReplicationMode REPLICATION_MODE_ON_CHANGE = 2

Replicate the given property on process by sending updates using reliable transfer mode when its value changes.


Method Descriptions

void add_property ( NodePath path, int index=-1 )

Adds the property identified by the given path to the list of the properties being synchronized, optionally passing an index.

Note: For details on restrictions and limitations on property synchronization, see MultiplayerSynchronizer.


NodePath[] get_properties ( ) const

Returns a list of synchronized property NodePaths.


bool has_property ( NodePath path ) const

Returns whether the given path is configured for synchronization.


int property_get_index ( NodePath path ) const

Finds the index of the given path.


ReplicationMode property_get_replication_mode ( NodePath path )

Returns the replication mode for the property identified by the given path. See ReplicationMode.


bool property_get_spawn ( NodePath path )

Returns whether the property identified by the given path is configured to be synchronized on spawn.


bool property_get_sync ( NodePath path )

Returns whether the property identified by the given path is configured to be synchronized on process.

Deprecated. Use property_get_replication_mode instead.


bool property_get_watch ( NodePath path )

Returns whether the property identified by the given path is configured to be reliably synchronized when changes are detected on process.

Deprecated. Use property_get_replication_mode instead.


void property_set_replication_mode ( NodePath path, ReplicationMode mode )

Sets the synchronization mode for the property identified by the given path. See ReplicationMode.


void property_set_spawn ( NodePath path, bool enabled )

Sets whether the property identified by the given path is configured to be synchronized on spawn.


void property_set_sync ( NodePath path, bool enabled )

Sets whether the property identified by the given path is configured to be synchronized on process.

Deprecated. Use property_set_replication_mode with REPLICATION_MODE_ALWAYS instead.


void property_set_watch ( NodePath path, bool enabled )

Sets whether the property identified by the given path is configured to be reliably synchronized when changes are detected on process.

Deprecated. Use property_set_replication_mode with REPLICATION_MODE_ON_CHANGE instead.


void remove_property ( NodePath path )

Removes the property identified by the given path from the configuration.