blender-motion-state-inspection
AFaffaan-m/ECC315k4,381 new stars in the last 7 days
Adds and configures in-game voice and text chat with Unity Vivox. Use when asked to add voice or text chat to a multiplayer game, such as team channels, proximity voice, mute controls or private messages.
Namespace: Unity.Services.Vivox | Package: com.unity.services.vivox
Companion packages: Unity.Services.Core, Unity.Services.Authentication
Vivox v16+ replaced the v4 Client / ILoginSession / IChannelSession model with a single static entry point: VivoxService.Instance. All operations — init, login, channel join, messaging, muting — go through it. Do not use v4 patterns (Client.Instance, AccountId, ChannelId, ILoginSession, UnityPurchasing.*, etc.); those are gone in v16.
unity command --format json) and the unity-cli and unity-pipeline skills for each step.unity command script eval --code '<snippet>'. Don't use using directives or unqualified types in the snippet. The compiler reads using UnityEngine and a bare AssetDatabase, Volume, or Object causes errors (CS0246 / CS0103 / CS0104). return what you want to read; it arrives at data.result.result.Before you go forward with a workflow or diagnosis:
This is because your training knowledge about Unity might be out of date, incorrect, or for the wrong Unity version.
The Vivox docs pages are online .md pages on docs.unity.com. Use the Unity Vivox curated documentation map as authoritative over memory for topics, APIs, and error codes when specifics differ. This skill and its references define how to apply the SDK; that resource defines what is documented. Never mention the llms.txt filename to the user. If it's unreachable, treat this skill's references plus the installed package at <project-folder>/Library/PackageCache/com.unity.services.vivox@*/ as the source of truth. Read only the .md and .cs files in that specific PackageCache subfolder, because the package doesn't ship the full Vivox docs. You must not look outside at other Library or PackageCache folders, otherwise it takes too much time.
Prefer fetching the page directly (for example WebFetch) over searching (for example WebSearch) — faster and lands on the exact reference. Only fetch what you need, and only search if you don't have the exact URL. The following Vivox pages have no version in the URL, so fetch them as listed.
ChannelJoined and ChannelLeft handlers.Channel3DProperties distances, fade intensity and fade model defaults.The API reference URLs contain <VERSION>. Replace it with the major.minor version only, for example 6000.0 from 6000.0.58f1 in ProjectSettings/ProjectVersion.txt, or 16.9 for the package in Packages/packages-lock.json, because the full build number gives a 404.
The API is Unity.Services.Vivox, part of the com.unity.services.vivox package. It is versioned by package version, not Unity version (e.g. @16.4, @16.9), so check the project's installed package version before relying on a specific class or method.
Packages/packages-lock.json.https://docs.unity3d.com/Packages/com.unity.services.vivox@<VERSION>/xrefmap.yml (replace <VERSION> with the installed package version, e.g. 16.9). This file maps every public API member's fully qualified name to its docs page href (e.g. href: api/Unity.Services.Vivox.IVivoxService.html => https://docs.unity3d.com/Packages/com.unity.services.vivox@<VERSION>/api/Unity.Services.Vivox.IVivoxService.html).Always fetch the version matching the installed package rather than relying on training knowledge, since APIs are frequently marked obsolete between major versions (e.g. the v4 Client and ILoginSession model is gone in v16).
The microphone permission API is UnityEngine.Android.Permission, part of the Unity Engine. It is versioned by Unity version, so check the project's Unity version before relying on a specific class or method.
unity-cli skill to check the project's Unity version.Data/Documentation folder (e.g. .../Unity/Hub/Editor/6000.6.0b2/Editor/Data/Documentation), grep the html files in the en/ScriptReference folder inside, and skip the remaining steps.https://docs.unity3d.com/<VERSION>/Documentation/ScriptReference/xrefmap.yml (replace <VERSION> with the Unity version, e.g. 6000.3). This file lists every public API member's fully qualified name as a uid (e.g. uid: 'UnityEngine.Rigidbody.AddForce(UnityEngine.Vector3)').uid to a markdown page: remove the parameters in brackets, lowercase it, replace . with /, and add .md. Then fetch https://docs.unity.com/en-us/engine/<VERSION>/script-reference/<converted uid>. For example, UnityEngine.Rigidbody.AddForce(UnityEngine.Vector3) => https://docs.unity.com/en-us/engine/<VERSION>/script-reference/unityengine/rigidbody/addforce.md. All overloads are on the same page.
ctor (e.g. unityengine/vector3/ctor.md), and indexers use item (e.g. unityengine/vector3/item.md).unityengine/vector3.md) and follow its link./engine/. Add https://docs.unity.com/en-us before them.href in the xrefmap.yml entry instead (e.g. href: 'Rigidbody.AddForce.html' => https://docs.unity3d.com/<VERSION>/Documentation/ScriptReference/Rigidbody.AddForce.html).If the Unity version is earlier than 6000.0, the Engine xrefmap.yml and .md pages don't exist, so fetch https://docs.unity3d.com/<VERSION>/Documentation/ScriptReference/Android.Permission.RequestUserPermission.html directly.
Always use the docs for the project's Unity version rather than relying on training knowledge, since APIs are frequently marked obsolete between versions.
Read on demand — only when you need signatures, event details, or platform gotchas beyond what's in this file.
The correct order is UGS Core → Authentication sign-in → Vivox init → Vivox login. Skipping or reordering these fails silently or throws obscure errors.
using Unity.Services.Core;
using Unity.Services.Authentication;
using Unity.Services.Vivox;
async void Start()
{
await UnityServices.InitializeAsync();
await AuthenticationService.Instance.SignInAnonymouslyAsync();
await VivoxService.Instance.InitializeAsync();
// subscribe to events (see table below) BEFORE calling LoginAsync
await VivoxService.Instance.LoginAsync(new LoginOptions { DisplayName = "Bob" });
}
VivoxService.Instance.InitializeAsync() twice throws 5041 VxErrorAlreadyInitialized. Guard against re-init on scene reload.AuthenticationService) is not used, the player identity falls back to a per-session GUID — display names still work but you lose cross-session identity. See references/init-and-login.md for the Vivox Access Token (VAT) alternative.Vivox has three join methods, one per channel type. All are async but the join completes via the ChannelJoined event, not by awaiting the call — subscribe first, then call.
| Method | Purpose |
|---|---|
VivoxService.Instance.JoinGroupChannelAsync(name, ChatCapability, ChannelOptions?) | Non-positional (party, team, lobby, guild) |
VivoxService.Instance.JoinEchoChannelAsync(name, ChatCapability, ChannelOptions?) | Test channel that echoes your own audio back |
VivoxService.Instance.JoinPositionalChannelAsync(name, ChatCapability, Channel3DProperties, ChannelOptions?) | 3D spatial audio driven by transform position |
ChatCapability values: TextOnly, AudioOnly, TextAndAudio.
Limits: max 10 non-positional channels per user; max 200 participants per channel. Exceeding either fails with 20502 VxXmppServerErrorServiceUnavailable. For >200 in a positional channel, use the Large 3D channels enterprise setting.
Leave with VivoxService.Instance.LeaveChannelAsync(channelName) or LeaveAllChannelsAsync(). See references/voice-channels.md for Channel3DProperties fields and mic-permission handling on Android/iOS.
Channel messages (broadcast to all participants of a channel with TextOnly or TextAndAudio):
VivoxService.Instance.SendChannelTextMessageAsync(string channelName, string message)VivoxService.Instance.ChannelMessageReceived (Action<VivoxMessage>)Directed messages (peer-to-peer, no channel required):
VivoxService.Instance.SendDirectTextMessageAsync(string playerId, string message)VivoxService.Instance.DirectedMessageReceived (Action<VivoxMessage>)Common hallucination: the send method is SendDirectTextMessageAsync — not SendDirectedTextMessageAsync. The event, however, is DirectedMessageReceived. Note the asymmetry.
VivoxMessage fields: ChannelName (null for directed), SenderDisplayName, SenderPlayerId, MessageText, ReceivedTime, Language, FromSelf, MessageId.
Edit/delete APIs (EditChannelTextMessageAsync, DeleteChannelTextMessageAsync, EditDirectTextMessageAsync, DeleteDirectTextMessageAsync) and history (GetChannelTextMessageHistoryAsync, GetDirectTextMessageHistoryAsync) are covered in references/text-chat.md. Chat history retention is 7 days by default.
Subscribe to events before the corresponding async call. LoggedIn may fire immediately for reconnects; ChannelJoined fires as the join completes.
| Call | Success Event | Failure / Counterpart |
|---|---|---|
LoginAsync() | LoggedIn | LoggedOut |
JoinGroupChannelAsync() / JoinEchoChannelAsync() / JoinPositionalChannelAsync() | ChannelJoined(string channelName) | ChannelLeft(string channelName) |
| — (any joined channel) | ParticipantAddedToChannel(VivoxParticipant) | ParticipantRemovedFromChannel(VivoxParticipant) |
SendChannelTextMessageAsync() (remote receive) | ChannelMessageReceived(VivoxMessage) | — |
SendDirectTextMessageAsync() (remote receive) | DirectedMessageReceived(VivoxMessage) | — |
Always unsubscribe in OnDestroy / OnDisable. VivoxService.Instance is a persistent singleton — event handlers on destroyed MonoBehaviours will double-fire and NRE on scene reload.
Per-participant events (ParticipantMuteStateChanged, ParticipantSpeechDetected, ParticipantAudioEnergyChanged) live on the VivoxParticipant instance you receive from ParticipantAddedToChannel — not on VivoxService.Instance. See references/events-and-participants.md.
The default path uses UGS Authentication — Vivox mints access tokens automatically from your UGS project once AuthenticationService.Instance.SignInAnonymouslyAsync() (or another sign-in method) has completed. No manual token code is required for standard flows.
Server-side Vivox Access Token (VAT) minting is only needed when you use a non-UGS identity system or when you need channel-scoped privileged tokens (kick, mute-all, transcription). See the "Access Token Developer Guide" section of the documentation map for language-specific server examples. Do not embed HMAC signing keys in the client.
After writing code that uses this package:
using Unity.Services.Vivox; resolves.UnityServices.InitializeAsync → AuthenticationService.Instance.SignInAnonymouslyAsync → VivoxService.Instance.InitializeAsync → VivoxService.Instance.LoginAsync.Client.Instance, no AccountId, no ChannelId, no ILoginSession, no IChannelSession. All access goes through VivoxService.Instance.OnDestroy.await the join call as if it completes join — it subscribes to ChannelJoined and reacts there.SendDirectTextMessageAsync (NOT SendDirectedTextMessageAsync). Directed message receive uses DirectedMessageReceived.RECORD_AUDIO at runtime before joining an audio channel; iOS builds have NSMicrophoneUsageDescription in the plist.SECRET/APP_ID — VAT-based flows are documented but delegated to a server.Do the following checks:
console status for counts.script eval rather than adding logging. Take no screenshots as they take too much time.If a check fails, go back and reread the docs pages to find out what you missed.
Give the user a concise but not dense checklist of what you did and why, including any incidental side effects (for example, settings you toggled to test something, or temporary files you created). If the user needs to follow up with more steps or decisions, list them. For example:
I made the following changes:
[✓] Created a `VivoxBootstrap.cs` script that signs in, logs in to Vivox, and joins a `team-blue` group channel.
Follow these steps to see the effect:
1. Enable Vivox for your project in the Unity Dashboard, and link the Unity project to it.
2. Add the script to a GameObject in the first scene.
3. Enter Play mode and check the Console shows no Vivox errors.
AFaffaan-m/ECC315k4,381 new stars in the last 7 days
Generate flow fields and particle systems with p5.js, using seeded randomness for original algorithmic art.
ANanthropics/skills203k3,265 new stars in the last 7 days
ANanthropics/skills203k3,265 new stars in the last 7 days
HAharry0703/MoneyPrinterTurbo147k1,608 new stars in the last 7 days
SHShubhamsaboo/awesome-llm-apps147k907 new stars in the last 7 days
GAgarrytan/gstack143k598 new stars in the last 7 days