Unity Xr logo

Unity Xr

CommunityPopular
Besty0728
unity-xr

Set up XR Interaction Toolkit (XRI) for VR/AR

Overview

PublisherBesty0728
RepositoryUnity-Skills
Skill nameunity-xr
Stars
1.9K
Forks
176
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Besty0728 on GitHub. Read the source before you install it.

Installation

Install the Unity Xr AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/xr
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.

Use it in TypingMind

Enable Unity Xr in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Unity Xr on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Unity Xr is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Before calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via GET /skills/recommend?includeSchema=true) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.

Triggers

  • Building VR/AR interaction
  • Setting up an XR rig
  • Configuring grab/socket/ray interactors
  • 构建 VR/AR 交互、搭建 XR rig、配置抓取/插槽/射线交互器

Unity XR Interaction Toolkit Skills

Use this module for XR Interaction Toolkit setup and configuration. All xr_* skills are reflection-based and support XRI 2.x on Unity 2022 and XRI 3.x on Unity 6+.

Requires: com.unity.xr.interaction.toolkit. Hard rule: Read this file before the first xr_* call in a session. Wrong property names can fail silently because the bridge is reflection-based.

Guardrails

Operating Mode (v1.9 three-tier):

  • Approval (default): query/list/info skills (xr_check_setup, xr_get_scene_report, xr_list_interactors, xr_list_interactables) run directly. Create/modify skills are FullAuto — on MODE_RESTRICTED, run the grant protocol; a successful /permission/grant executes the skill server-side and returns the result in the same response.
  • Auto / Bypass: SemiAuto and FullAuto run directly.
  • This module contains no Delete / PlayMode / Reload / RiskLevel="high" skills, so nothing is auto-classified as forbidden — every skill is reachable via grant.
  • When com.unity.xr.interaction.toolkit is missing, every xr_* skill returns the NoXRI() install instruction instead of executing.
  • Reflection-sensitive: property names on XRI components must match XRI 2.x/3.x exactly. A wrong field name on xr_configure_interactable / xr_configure_haptics is silently ignored; xr_configure_interaction_layers takes layer names or an integer mask and rejects undefined names. Load API_REFERENCE.md before issuing detailed property edits.

DO NOT (common hallucinations):

  • XRHand, XRPlayer, XRTeleporter, GrabInteractor, VRController, XRLocomotion, and XRManager are not the runtime classes you want here
  • interactable.OnGrab() / OnRelease() are not the XRI event model -> use selectEntered / selectExited
  • controller.vibrate() is not the documented route here -> configure haptics through xr_configure_haptics
  • Do not assume physics Layer or Tag replaces InteractionLayerMask
  • Do not guess component property names. Load API_REFERENCE.md before setting detailed XR component properties

Correct class names to anchor on:

  • XRInteractionManager
  • XROrigin
  • XRRayInteractor
  • XRDirectInteractor
  • XRSocketInteractor
  • XRGrabInteractable
  • XRSimpleInteractable
  • TeleportationProvider
  • TeleportationArea
  • TeleportationAnchor
  • ContinuousMoveProvider
  • SnapTurnProvider
  • ContinuousTurnProvider
  • TrackedDeviceGraphicRaycaster
  • XRUIInputModule
  • TrackedPoseDriver

Routing:

  • For non-XR Canvas UI creation -> use ui
  • For architecture or lifecycle decisions in XR gameplay code -> load advisory modules such as architecture, patterns, async, or scriptdesign
  • For exact component property names and full workflow examples -> load API_REFERENCE.md

Skills

Setup and Diagnostics

SkillUseKey parameters
xr_check_setupValidate XR package, rig, managers, and scene prerequisitesverbose?
xr_setup_rigCreate XR Origin + camera + controllersname, cameraYOffset?
xr_setup_interaction_managerAdd or find managernone
xr_setup_event_systemReplace/add XR UI input stacknone
xr_get_scene_reportReport scene-side XR statusnone

Interactors and Interactables

SkillUseKey parameters
xr_add_ray_interactorRemote pointing / ray interactionname, maxDistance?, lineType?
xr_add_direct_interactorClose-range hand grabname, radius?
xr_add_socket_interactorSnap-to slotname, showHoverMesh?, recycleDelay?
xr_add_grab_interactableRigidbody + collider + grab configname, movementType?, throwOnDetach?
xr_add_simple_interactableHover/select without grabname
xr_configure_interactableFine-tune interactable behaviortarget + changed fields only
xr_list_interactorsList all scene interactorsnone
xr_list_interactablesList all scene interactablesnone

Locomotion and XR UI

SkillUseKey parameters
xr_setup_teleportationAdd teleport provider to XR Originnone
xr_add_teleport_areaMark a surface as teleportablename, matchOrientation?
xr_add_teleport_anchorCreate fixed teleport destinationname, x/y/z, rotY?, matchOrientation?
xr_setup_continuous_moveAdd stick locomotionmoveSpeed?, enableStrafe?, enableFly?
xr_setup_turn_providerAdd snap or smooth turnturnType, turnAmount?, turnSpeed?
xr_setup_ui_canvasConvert Canvas for XR interactionname

Feedback and Filtering

SkillUseKey parameters
xr_configure_hapticsSet hover/select vibrationname, intensities, durations
xr_add_interaction_eventWire interaction callback to target methodname, eventType, targetName, targetMethod
xr_configure_interaction_layersSet InteractionLayerMaskname, layers, isInteractor

Quick Start

python
import unity_skills as u

u.call_skill("xr_check_setup")
u.call_skill("xr_setup_rig", name="XR Origin")
u.call_skill("xr_add_ray_interactor", name="Right Controller")
u.call_skill("xr_add_direct_interactor", name="Left Controller")
u.call_skill("xr_setup_teleportation")
u.call_skill("xr_setup_turn_provider", turnType="Snap", turnAmount=45)
u.call_skill("xr_add_grab_interactable", name="MyCube", movementType="VelocityTracking")

Workflow Summary

Rig Setup

  1. Run xr_check_setup.
  2. Create the rig with xr_setup_rig.
  3. Ensure XR UI input exists with xr_setup_event_system.
  4. Add at least one interactor per controller.

Grab Setup

  • Direct hand grab: xr_add_direct_interactor + xr_add_grab_interactable
  • Distance grab: xr_add_ray_interactor + xr_add_grab_interactable
  • Socket placement: xr_add_socket_interactor + grabbable object

movementType defaults matter:

  • VelocityTracking: best general-purpose physical grab
  • Kinematic: use for handles/tools that should not get stuck
  • Instantaneous: best for precise remote grab

Locomotion Setup

  • Teleport: xr_setup_teleportation + xr_add_ray_interactor + xr_add_teleport_area/xr_add_teleport_anchor
  • Continuous locomotion: xr_setup_continuous_move
  • Turn: xr_setup_turn_provider

Comfort default: snap turn + moderate move speed (~2.0 m/s).

XR UI

  1. Convert Canvas with xr_setup_ui_canvas
  2. Ensure xr_setup_event_system
  3. Add a ray interactor on the controller that should click UI

Collider Configuration Matrix

This is the most important XR anti-hallucination table in the repo.

ComponentCollider requiredisTriggerRecommended colliderReason
XRDirectInteractorYesTrueSphereCollider (0.1-0.25)Overlap detection
XRRayInteractorNo-NoneUses raycasts
XRSocketInteractorYesTrueSphereCollider (0.1-0.3)Snap zone
XRGrabInteractableYesFalseBoxCollider or convex MeshColliderPhysics + ray target
XRSimpleInteractableYesFalseBoxColliderSelection detection
TeleportationAreaYesFalseMeshCollider or BoxColliderSurface raycast target
TeleportationAnchorYesFalseThin BoxColliderPoint raycast target

Critical rules:

  1. XRGrabInteractable needs a Rigidbody.
  2. A grabbable collider must not be trigger.
  3. A direct interactor collider must be trigger.
  4. Dynamic mesh colliders must be convex.
  5. Socket colliders should be trigger-only overlap zones.

Version Compatibility

TopicXRI 2.xXRI 3.x
Main namespace styleroot namespacesplit sub-namespaces
Rig typeXROriginXROrigin
Locomotion coreLocomotionSystemLocomotionMediator
Controller typeActionBasedControllerActionBasedController
Bridge behaviorReflection helper falls back automaticallyReflection helper prefers 3.x first

Important Notes

  1. Scenes should normally have exactly one XRInteractionManager.
  2. Most locomotion skills assume an XROrigin already exists.
  3. Package installation or reconfiguration can trigger Domain Reload. Wait before retrying XR calls.
  4. Use InteractionLayerMask for interactor/interactable filtering.
  5. For custom XR scripts, prefer XRI lifecycle hooks and events over Update() polling when possible.

Minimal Example

python
import unity_skills as u

u.call_skill("xr_setup_rig", name="XR Origin", cameraYOffset=1.36)
u.call_skill("xr_setup_event_system")
u.call_skill("xr_add_ray_interactor", name="Right Controller", maxDistance=30, lineType="StraightLine")
u.call_skill("xr_add_grab_interactable", name="Tool", movementType="VelocityTracking", throwOnDetach=True)
u.call_skill("xr_configure_haptics", name="Right Controller", selectIntensity=0.7, selectDuration=0.15)

Exact Signatures

Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file. Before configuring XR component properties in detail, load API_REFERENCE.md. XR property names are reflection-sensitive.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Unity Xr AI skill do?

Set up XR Interaction Toolkit (XRI) for VR/AR

Why use Unity Xr on TypingMind?

Because you install it once and use it with any model. Unity Xr is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Unity Xr in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/xr. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Unity Xr?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Unity Xr?

As many as you like. As long as a model supports skills, you can use Unity Xr with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Unity Xr AI skill free?

Yes. It is published on GitHub by Besty0728 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇