Skip to content

SceneMultiplayer.allow_object_decoding() should specify that this does not work with custom objects #12006

Description

@lostdisplay

Your Godot version: 4.6

Issue description:
SceneMultiplayer.allow_object_decoding should specify that this does not work with custom objects.

For example:

# player.gd
class_name Player extends RefCounted

var id: int
var slot: int
var name: String

# lobby.gd
func connected_to_server() -> void:
	# add data to player...
	_register_player.rpc(player)

@rpc("any_peer", "reliable")
func _register_player(_player: Player) -> void:
	# _player will be empty

URL to the documentation page:
https://docs.godotengine.org/en/stable/classes/class_scenemultiplayer.html#class-scenemultiplayer-property-allow-object-decoding

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:class referenceIssues and PRs about the class reference, which should be addressed on the Godot engine repositoryenhancementtopic:multiplayer

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions