Skip to content

Commit 665342c

Browse files
committed
Document SceneTree.set_multiplayer() should be called in _enter_tree()
If it's called in `_ready()`, it will be too late as child nodes will already be set up by the time the custom multiplayer API is set.
1 parent 1696ab0 commit 665342c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

doc/classes/SceneTree.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@
234234
<description>
235235
Sets a custom [MultiplayerAPI] with the given [param root_path] (controlling also the relative subpaths), or override the default one if [param root_path] is empty.
236236
[b]Note:[/b] No [MultiplayerAPI] must be configured for the subpath containing [param root_path], nested custom multiplayers are not allowed. I.e. if one is configured for [code]"/root/Foo"[/code] setting one for [code]"/root/Foo/Bar"[/code] will cause an error.
237+
[b]Note:[/b] [method set_multiplayer] should be called [i]before[/i] the child nodes are ready at the given [param root_path]. If multiplayer nodes like [MultiplayerSpawner] or [MultiplayerSynchronizer] are added to the tree before the custom multiplayer API is set, they will not work.
237238
</description>
238239
</method>
239240
<method name="unload_current_scene">

0 commit comments

Comments
 (0)