Immerseum SDK: VR Simulator (version: RC-1.0.0)
      [view as: Desktop | Tablet | Mobile]
Configuring Input & Movement
In This Topic

Gracefully handling input from various user devices and translating that to player movement in your VR scene is the most complicated part of the VRSimulator's functionality. But the good news is that it works right out of the box!

If you want to understand how it works and how to configure it to work with your VR experience, it would be helpful to first explain how input and movement in the VRSimulator work.

Overview of Input & Movement

The way movement works in any VR experience (or computer game, etc.) is really straightforward:

 

The software needs to receive (capture) the user's input from whatever device was used. Based on the input received (what button was pressed, what thumbstick was moved, etc.) the system needs to decide what that input means ("Move the player forward", "Fire the blaster cannon", etc.). And once that decision is made, the system needs to respond and do whatever it should do ("Move the player one step forward", "Start the process of firing the blaster cannon").

Where this can get complicated is that most input devices are built and designed differently, have different hardware features, different drivers, etc. And different experiences (and even different users within the same experience!) may want to have different button layouts, controller configurations, etc. for their style of play. Trying to accommodate all of the variability that's out there can get very complicated, very fast.

Which is why we have broken this process into four key concepts:

 

So why does any of this matter to you? Honestly, it doesn't need to. The VRSimulator comes pre-packaged and configured to include:

If you are comfortable with the way we've defined our default movement mapping, you don't need to do anything other than configure your user experience in the Unity Inspector.

Managing Your Input Settings

If you are using the VRSimulator's default Input Actions, your project's Input Manager will need to have the corresponding input settings. You can either apply these settings permanently for your project, or you can have the VRSimulator temporarily apply those settings when you enter play mode in the Unity Editor.

Best Practice Best Practice
The VRSimulator's input settings are additive to Unity's default input settings. If your project uses custom input settings, you will need to add them back into the Input Manager after permanently applying the VR Simualtor's input settings to your project.

To Apply Input Settings Permanently to Your Project

You can apply our input settings directly from the Unity Inspector. Just view the [VRSimulator] object and take a look at the InputActionManager component. There, depending on the configuration of your project's Input Manager, you will either see a button that lets you Apply InputManager Settings when clicked, or a message that says your input settings are properly configured:

 

Be Aware Be Aware

Before these settings get applied to your project, you will be prompted to confirm. This step clears your existing Input Manager settings and cannot be undone (without going in and changing the settings again) so please be certain you want to do this.

Once these settings have been applied, you are welcome to add new settings if you need additional ones.

To Apply Input Settings Temporarily

If you don't change your project's Input Manager settings permanently, but still want to use the VRSimulator's default Input Actions, Unity will prompt you to apply our default input settings every time you enter play mode.

Temporarily Applying VRSimulator Input Settings

Temporarily Applying VRSimulator Input Settings

Be Aware Be Aware

If your project is using custom input settings, those custom input settings will not be present when running your scene with temporarily-applied input settings.

In other words, temporarily applied input settings will (temporarily) over-write whatever custom input settings you have defined.

If you wish to use custom input settings in addition to the VRSimulator's input settings, then apply the VRSimulator's input settings permanently and then re-introduce your custom settings in the Unity Input Manager.

Configuring Movement 

If you are using the VRSimulator's default movement mapping, you can adjust your user experience using the MovementManager's settings in the Unity Inspector.

Managing Strafe / Look Controls

Strafing is a mainstay in first-person shooter movement, and the VRSimulator supports it. However, strafing is also known to significantly contribute to simulation sickness in VR experiences. Therefore, we've made it an optional feature.

If Is Strafe Enabled is activated, then when you press the sidways buttons or move a thumbstick to the side, your player avatar will strafe: They will move sideways in the direction you indicated. To rotate the camera and simulate where your user is looking, you will need to use the default look-only controls on the keyboard, mouse, or gamepad.

However, if Is Strafe Enabled is deactivated, then when you press the sideways buttons or move a thumbstick to the side, you will only adjust the direction in which your player avatar is facing (the character's yaw rotation). Your default look-only controls will still work, but now the character can only move forwards / backwards relative to the direction they are facing.

Best Practice Best Practice

Keeping Is Strafe Enabled deactivated makes the simulated experience most-closely match a real VR experience (it's actually surprisingly difficult / weird / rare to strafe in the physical world). That's why it is deactivated by default.

However, there are times when you want to move your user into a particular position to test particular things, and that becomes easier in the simulation if you have strafe enabled (i.e. just slide the character somewhere, then rotate them).

While in Play Mode you can activate / deactivate Is Strafe Enabled on-the-fly to adjust the UX however you need to.

Managing Run

You can enable or disable the ability for your user to run (move at twice normal speed) using the Is Run Enabled setting in the MovementManager.  If running is enabled, the default inputs feature controls that toggle run-mode on / off as you play. If running is disabled, these input controls will not make your player run.

You can adjust whether the player is currently in run-mode by toggling the Is Run Active setting in the MovementManager. This setting is only available if running is enabled, but it will always indicate whether the user is currently in walk (unchecked) or run (checked) mode.

Best Practice Best Practice

We have found that keeping Is Run Enabled activated during the development process to be very helpful.

Often while developing a VR scene we will want to move the user's avatar to a particular position when testing in Play Mode. By enabling run mode and then activating it (using the Is Run Active setting), we can move the player's avatar through the VR scene very quickly, without messing with any stuff in the inspector that might break our scene.

Managing Your Gamepad Triggers

The XBox One Controller - like all gamepads - features multiple triggers. These triggers are mapped to two specific InputActions: one for the primary trigger, and one for the secondary trigger. But in order to properly map these InputActions back to the triggers, you need to tell the VRSimulator which trigger you want to be primary (the other will automatically become secondary).

You can do this by selecting Left or Right in the Gamepad Primary Trigger setting in the MovementManager.

Be Aware Be Aware

The VRSimulator doesn't have any input handling for either a primary trigger pull or a secondary trigger pull. They're usually not related to movement, after all.

However, by default trigger pulls are captured as InputActions so that you can listen for a corresponding Input Action Event and respond accordingly.

Customizing Movement Controls

If you do not want to use our default movement controls, you can customize input handling to create your own movement logic. This does not mean you need to define your own custom InputAction mapping.

To customize movement controls while using our default InputAction mapping, you would need to:

  1. Turn off the Default Input Map in the MovementManager's settings.
  2. Write a custom input handling method to respond to each of the default InputActions that you wish to support.
  3. Create an InputAction Event listener method.
  4. Check the name of the InputAction against the list of default Input Actions, and then call the corresponding custom input handling method you wrote in (2) above.

For a walkthrough of how to do this, please see Custom Input Handling.

Customizing InputActions

Using C# scripting, it is possible to either:

Be Careful! Be Careful!
This is an advanced technique, and one that can get quite complicated. Use with caution!

To learn how to customize InputActions, please review Custom InputAction Mapping.

See Also

Configuring the VRSimulator

Reference

 

 


2017 Copyright © Immerseum Inc. All rights reserved.

Send Feedback