Difference between revisions of "Set up VR in Unity"
Line 65: | Line 65: | ||
[[File:14_xr_preset_manager.png|600px]]<br/> | [[File:14_xr_preset_manager.png|600px]]<br/> | ||
+ | <br/> | ||
+ | |||
+ | |||
+ | |||
+ | '''8.now you can add an XR Rig - Action Based to your project:''' | ||
+ | Game Object / XR / XR Rig Action Based<br/> | ||
+ | [[File:15_xr_xr_rig.png| 500px]]<br/> | ||
+ | '''8b.Add "Input Action Manager" to the XR rig:'''<br/> | ||
+ | In the inspector for the "XR rig" Game Object , add a component called "Input Action Manager"<br/> | ||
+ | [[File:16_xr_input_action_manager.png|600px]]<br/> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
in the component under "Action Assets" change the number to 1 and expand | in the component under "Action Assets" change the number to 1 and expand | ||
click on the dot to select "XRI default input actions"<br/> | click on the dot to select "XRI default input actions"<br/> | ||
− | 9. You may have to enable the following setting: "Window/Analysis/Input Debugger/Options/Lock Input to Game View" | + | [[File:17_input_actions.png|600px]]<br/> |
+ | [[File:17_input_actions_b.png|400px]]<br/> | ||
+ | |||
+ | '''9.Set the XR rig tracking origin mode to Floor:'''<br/> | ||
+ | [[File:16_xr_rig_floor.png|400px]]<br/> | ||
+ | |||
+ | '''9.Lock input to game view:'''<br/> | ||
+ | You may have to enable the following setting: "Window/Analysis/Input Debugger/Options/Lock Input to Game View"<br/> | ||
+ | [[File:18_input_debugger.png|600px]]<br/> | ||
+ | [[File:19_lock_input_to_game_view.png|600px]]<br/> |
Revision as of 14:05, 19 January 2022
Setting up VR and XR interaction toolkit project in Unity for versions 2019.4,2020.x & 2021.1
1. Install XR plugin management:
edit / project settings / xr plugin management / install xr pluging management
2. Add Oculus to the plugin providers:
tick the Oclus box (if using oculus) open xr if using others
Choose your PlayMode Open XR Runtime
3. Enable the Interaction Profile for Oculus:
4.Enable preview Packages in the Package Manager:
Window / Package Manager
in the package manager click on the gear and choose "advanced project settings"
under "Advanced Settings" tick on "Enable Preview Packages"
5.In the package Manager install "XR Interaction Toolkit":
at the top left of the package manager select Packages: Unity Registry
Find and select XR interaction Toolkit
click install in the lower right corner of the package manager
5b. In the XR Interaction Toolkit Package samples, install the Default Input Actions:
Download and import the Default Input Actions
6.Locate the Default Input Actions folder you've just imported:
You'll find this in the Project tab under assets:
Assets / Samples / XR interaction toolkit / 1.*.*.*.* / Default Input Actions /
select "XRI Default Left Controller" - In the inspector click "Add to ActionBasedController default"
repeat the same for the right controller
7.Change the filter for the ActionBasedController in the Preset Manager:
edit / project settings
in the project settings window select "preset manager"
under Action Based Controller in the filter add
"left" to the filter for "XRI Default left Controller"
"right" to the filter for "XRI Default right Controller"
8.now you can add an XR Rig - Action Based to your project:
Game Object / XR / XR Rig Action Based
8b.Add "Input Action Manager" to the XR rig:
In the inspector for the "XR rig" Game Object , add a component called "Input Action Manager"
in the component under "Action Assets" change the number to 1 and expand
click on the dot to select "XRI default input actions"
9.Set the XR rig tracking origin mode to Floor:
9.Lock input to game view:
You may have to enable the following setting: "Window/Analysis/Input Debugger/Options/Lock Input to Game View"