Skip to content

Clarify that high-level RPC methods must be defined on Node-based scripts#11892

Open
deathtaco1408 wants to merge 2 commits intogodotengine:masterfrom
deathtaco1408:deathtaco1408-RPC-Warning
Open

Clarify that high-level RPC methods must be defined on Node-based scripts#11892
deathtaco1408 wants to merge 2 commits intogodotengine:masterfrom
deathtaco1408:deathtaco1408-RPC-Warning

Conversation

@deathtaco1408
Copy link
Copy Markdown

Summary

This PR clarifies that Godot's high-level RPC system is node-based and that methods marked with
@rpc should be defined on scripts attached to Node-derived classes.

Why

The current multiplayer documentation explains how RPCs are used, but it does not clearly state
that defining @rpc methods only on non-Node classes is not supported. This can lead to runtime
errors and confusion for users building helper abstractions around Resource or RefCounted
scripts.

This change adds a short clarification and example so developers understand where RPC methods should
live and how to structure helper code safely.

Related context

This addresses confusion described in issue #89981.

Scope

Documentation only. No engine behavior changes.

Clarify RPC method requirements and supported patterns in high-level multiplayer documentation.
Added a note about Godot's RPC system requirements for node-based scripts.
@deathtaco1408 deathtaco1408 requested review from a team as code owners March 31, 2026 05:03
@skyace65 skyace65 added enhancement area:manual Issues and PRs related to the Manual/Tutorials section of the documentation topic:network labels Apr 19, 2026
Copy link
Copy Markdown
Contributor

@Zacky3181V Zacky3181V left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes to meet documentation writing guidelines

func submit_input(input_vector: Vector2) -> void:
pass

If you need multiplayer RPC behavior, keep the RPC entry points on ``Node`` scripts and call into
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace
"If you need multiplayer RPC behavior"

with
"To implement RPC behavior"

RPC methods must be defined on Node-based scripts
-----------------------------------------------

Godot's high-level multiplayer RPC system is built around the scene tree and ``Node`` paths.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"is built around" -> "utilizes"

Godot's high-level multiplayer RPC system is built around the scene tree and ``Node`` paths.
In practice, RPC methods should be defined on scripts attached to ``Node``-derived classes.

Using ``@rpc`` on methods defined only in non-``Node`` classes (for example, plain ``Resource`` or
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be edited to be active voice?

High level multiplayer API does not support using @rpc on method defined in non-Node classes (for example, plain Resource or RefCounted-based helper scripts). It can result in runtime errors when calling rpc() or rpc_id().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement topic:network

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants