Table of Contents

Class RpcAttribute

Namespace
Godot
Assembly
GodotSharp.dll

Attribute that changes the RPC mode for the annotated method to the given Mode, optionally specifying the TransferMode and TransferChannel (on supported peers). See MultiplayerApi.RpcMode and MultiplayerPeer.TransferModeEnum. By default, methods are not exposed to networking (and RPCs).

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class RpcAttribute : Attribute
Inheritance
RpcAttribute
Inherited Members

Constructors

RpcAttribute(RpcMode)

Constructs a RpcAttribute instance.

public RpcAttribute(MultiplayerApi.RpcMode mode = RpcMode.Authority)

Parameters

mode MultiplayerApi.RpcMode

The RPC mode to use.

Properties

CallLocal

If the method will also be called locally; otherwise, it is only called remotely.

public bool CallLocal { get; init; }

Property Value

bool

Mode

RPC mode for the annotated method.

public MultiplayerApi.RpcMode Mode { get; }

Property Value

MultiplayerApi.RpcMode

TransferChannel

Transfer channel for the annotated mode.

public int TransferChannel { get; init; }

Property Value

int

TransferMode

Transfer mode for the annotated method.

public MultiplayerPeer.TransferModeEnum TransferMode { get; init; }

Property Value

MultiplayerPeer.TransferModeEnum