Skip to content

Objects whose _init() takes arguments fail to be decoded when sent over RPC #102093

Closed
@elenakrittik

Description

@elenakrittik

Tested versions

4.4dev7

System information

Godot v4.4.dev7 - Windows 10 (build 19045) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 32.0.15.6636) - AMD Ryzen 7 5800X 8-Core Processor (8 threads)

Issue description

Let's say you have a PlayerData Object that for convenience defines a constructor:

class_name PlayerData extends Object

var position: Vector3
var rotation: Vector3

func _init(position_: Vector3, rotation_: Vector3) -> void:
    self.position = position_
    self.rotation = rotation_

When you try to send a PlayerData over RPC, the receiving side fails to decode it because it doesn't know what to put into these arguments.

Steps to reproduce

Download the MRP. Open Debug > Customize Run Instances and configure it as shown here:

Image

Run the project. Observe the errors.

Minimal reproduction project (MRP)

netbug.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions