class-description NEWS COMMUNITY STORE LABS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE LABS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectNode MultiplayerSpawner
Automatically replicates spawnable nodes from the authority to other multiplayer peers.

Spawnable scenes can be configured in the editor or through code (see add_spawnable_scene).

Also supports custom node spawns through spawn, calling spawn_function on all peers.

Internally, MultiplayerSpawner uses MultiplayerAPI.object_configuration_add to notify spawns passing the spawned node as the object and itself as the configuration, and MultiplayerAPI.object_configuration_remove to notify despawns in a similar way.

despawned despawned<>( Node node=, node:Node=, ):despawned

Emitted when a spawnable scene or custom spawn was despawned by the multiplayer authority. Only called on puppets.

spawned spawned<>( Node node=, node:Node=, ):spawned

Emitted when a spawnable scene or custom spawn was spawned by the multiplayer authority. Only called on puppets.

Callable spawn_function<>():Callable

Method called on all peers when for every custom spawn requested by the authority. Will receive the data parameter, and should return a Node that is not in the scene tree.

Note: The returned node should not be added to the scene with Node.add_child. This is done automatically.

int spawn_limit<>():int

Maximum nodes that is allowed to be spawned by this spawner. Includes both spawnable scenes and custom spawns.

When set to 0 (the default), there is no limit.

NodePath spawn_path<>():NodePath

Path to the spawn root. Spawnable scenes that are added as direct children are replicated to other peers.

void add_spawnable_scene<>( String path=, path:String=, ):void

Adds a scene path to spawnable scenes, making it automatically replicated from the multiplayer authority to other peers when added as children of the node pointed by spawn_path.

void clear_spawnable_scenes<>():void

Clears all spawnable scenes. Does not despawn existing instances on remote peers.

String get_spawnable_scene<>( int index=, index:int=, ):String

Returns the spawnable scene path by index.

int get_spawnable_scene_count<>():int

Returns the count of spawnable scene paths.

Node spawn<>( Variant data=null, data:Variant=null, ):Node

Requests a custom spawn, with data passed to spawn_function on all peers. Returns the locally spawned node instance already inside the scene tree, and added as a child of the node pointed by spawn_path.

Note: Spawnable scenes are spawned automatically. spawn is only needed for custom spawns.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...