Learning Unitys XR Input System @WorldOfZeroDevelopment
Learning Unitys XR Input System  @WorldOfZeroDevelopment
Uploaded July 2019 | Updated November 2026, 1 hour ago
There are two ways to handle input in your VR games built with Unity. Right now we have used Unity's `Input` system to allow us to create Axis and Buttons which can be retrieved using the normal `Input.GetAxis` methods. This is... clunky... in VR. Different Headsets have different capabilities and various controllers will support different types of input. Continuing to rely on the `Input` class will mean that we'll have to implement some sort of system to check the capabilities of the device that we're using and see what features we can use to power our locomotion and other inputs. Luckily Unity has already implemented this system and created the XR Input system.

The XR Input system exists in parallel to the normal `Input` system that I've used in the past. Unlike `Input` which makes it possible to track inputs from specific pre-defined things, we can use the XR Input system to query the current capabilities of the VR system our computer is running. This makes it possible for us to ask Unity for the "Right Hand" or another similar object and get something understandable back. Once we have that object we can test various capabilities of the "Right Hand" such as the Trigger or Primary Axis of the controller. This makes it possible for us to have a lot more control over how input in our game works and also makes it far easier for us to adopt our game to different controllers used in VR.

This is my first time working with this new system and while it has its quirks (most VR API's are still maturing in my experience) I'm pretty happy with how well it works. Adopting it is also relatively straight-forward and doesn't require a dramatic amount of additional work when migrating from an existing system built on-top of the original `Input` based system.

What do you think?

Unity's documentation for the XR Input System is here and includes multiple additional examples: docs.unity3d.com/Manual/xr_input.html

The d-pad in this videos thumbnail was created by Lorc for the `game-icons` projects: github.com/game-icons/icons/tree/master/lorc.

Join the World of Zero Discord community: discord.gg/hU5Kq2u
Learning Unitys XR Input SystemUsing PowerShell to Create a Symbolic Link on WindowsBuilding Boids in Unity 3DWriting a Snow Covered ShaderUsing C#s Yield KeywordUsing Python and Argparse to Build Quick ScriptsRedesigning our C# Scripting in Unity ToolGenerating Images from SVGs with Unity and InkscapeExploring Zenject - Learning how to use Dependency Injection in UnityWhat Happens When You Snap Vertices To A Grid?Creating and Deleting Highscores - Online Highscores - Part 2Starting to Setup the Components - Day 1 - Building a Health Dashboard
World of Zero |

Learning Unity's XR Input System

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER