Toggling Seated Mode in a VRCStation (seated)

This example demonstrates how to enable or disable seated mode in a VRCStation, affecting the player's posture when using the station.

How It Works:

  • Interact to toggle whether the station forces the player into a seated position.

  • If seated = true, the player sits in a locked seated position.

  • If seated = false, the player remains in an upright standing position when using the station.

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
using VRC.SDK3.Components;

public class ToggleSeatedMode : UdonSharpBehaviour
{
    public VRCStation station; // Assign a VRCStation in the Inspector

    public override void Interact()
    {
        if (station != null)
        {
            // Toggle seated mode
            station.seated = !station.seated;

            Debug.Log("Seated mode: " + station.seated);
        }
    }
}

Last updated