docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Unity primitives

    Unity Primitive Color, Color32, Vector2, Vector3, Vector4, Quaternion, Ray, Ray2D types will be serialized by built-in serialization code.

    [Rpc(SendTo.ClientsAndHost)]
    void BarClientRpc(Color somecolor) { /* ... */ }
    
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.P))
        {
            BarClientRpc(Color.red); // Server -> Client
        }
    }
    
    In This Article
    Back to top
    Copyright © 2025 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)