Last active
August 10, 2020 16:43
-
-
Save ForestKatsch/d169b6fc6d8778b6c1d9fb56e07d1a45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sets the origin mode for XR. | |
// Add this component somewhere in your scene. | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.XR; | |
public class SetXROrigin : MonoBehaviour { | |
public TrackingOriginModeFlags originMode = TrackingOriginModeFlags.Floor; | |
void Start() { | |
List<XRInputSubsystem> subsystems = new List<XRInputSubsystem>(); | |
SubsystemManager.GetInstances<XRInputSubsystem>(subsystems); | |
foreach(var subsystem in subsystems) { | |
subsystem.TrySetTrackingOriginMode(originMode); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment