Setting a Custom Seating Animation with animatorController
This example demonstrates how to override the default seating animation in a VRCStation with a custom RuntimeAnimatorController.
How It Works:
Attach this script to an interactable object.
Assign a VRCStation and a custom RuntimeAnimatorController in the Inspector.
When the object is interacted with, the station's default animation will be overridden with the custom one.
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
using VRC.SDK3.Components;
public class CustomSeatAnimation : UdonSharpBehaviour
{
public VRCStation station; // Assign a VRCStation in the Inspector
public RuntimeAnimatorController customAnimator; // Assign a custom Animator Controller
public override void Interact()
{
if (station != null && customAnimator != null)
{
station.animatorController = customAnimator;
Debug.Log("Custom seating animation applied.");
}
else
{
Debug.LogWarning("Missing station or animator controller.");
}
}
}
PreviousControlling Station Switching with canUseStationFromStationNextPreventing Players from Exiting a Station with disableStationExit
Last updated