docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Enum SendTo

    Configuration for the default method by which an RPC is communicated across the network

    Namespace: Unity.Netcode
    Assembly: Unity.Netcode.Runtime.dll
    Syntax
    public enum SendTo

    Fields

    Name Description
    Authority

    Send this RPC to the authority. In distributed authority mode, this will be the owner of the NetworkObject. In normal client-server mode, this is basically the exact same thing as a server rpc.

    ClientsAndHost

    Send this RPC to all clients, including the host, if a host exists. If the server is running in host mode, this is the same as Everyone. If the server is running in dedicated server mode, this is the same as NotServer.

    Everyone

    Send this RPC to everone, filtered to the current observer list. Will execute locally.

    Me

    Execute this RPC locally.

    Normally this is no different from a standard function call.

    Using the DeferLocal parameter of the attribute or the LocalDeferMode override in RpcSendParams, this can allow an RPC to be processed on localhost with a one-frame delay as if it were sent over the network.

    NotAuthority

    Send this RPC to all non-authority instances. In distributed authority mode, this will be the non-owners of the NetworkObject. In normal client-server mode, this is basically the exact same thing as a client rpc.

    NotMe

    Send this RPC to everyone but the local machine, filtered to the current observer list.

    NotOwner

    Send to everyone but the current owner, filtered to the current observer list. Will execute locally if the local process is not the owner.

    NotServer

    Send to everyone but the server, filtered to the current observer list. Will NOT send to a server running in host mode - it is still treated as a server. If you want to send to servers when they are host, but not when they are dedicated server, use ClientsAndHost.

    Will execute locally if invoked on a client. Will NOT execute locally if invoked on a server running in host mode.

    Owner

    Send to the NetworkObject's current owner. Will execute locally if the local process is the owner.

    Server

    Send to the server, regardless of ownership. Will execute locally if invoked on the server.

    SpecifiedInParams

    This RPC cannot be sent without passing in a target in RpcSendParams.

    In This Article
    • Fields
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)