F01


Learning Outcomes

  • Apply VR coordinate systems. Practice Global vs. Local gizmos, test Unity’s left-handed axes, and compare world vs. local transforms. Review personal space zones to trigger cues when proximity boundaries are crossed.
  • Continue from the D1 VR scene. Work in your XFactoryVR scene with the XR setup copied from the VR Template SampleScene; verify OpenXR, input actions, and interaction profiles from D1.
  • Implement locomotion. Configure the copied XR Origin (XR Rig) with a Locomotion Mediator and XR Body Transformer; test teleportation, snap turn, continuous turn, and continuous move while avoiding conflicting locomotion inputs—especially by using only one turn style at a time.
  • Optimize for performance. Use 90 FPS as a common comfort target when appropriate, but treat performance budgets as device- and scene-dependent based on headset, refresh-rate setting, render scale, scene complexity, and course hardware. Batch static objects, reduce poly/texture costs, limit effects, and use MSAA where supported in URP.

Spatial Awareness

Spatial awareness in VR refers to the user’s ability to perceive and understand the positions, orientations, and relationships of objects—and of themselves—within a 3D virtual environment. This awareness is driven by multisensory input, including visual, auditory, and haptic cues, and is enhanced by technologies such as head tracking, hand/controller tracking, spatialized sound, and real-time feedback. To support this immersive perception, VR environments rely on a set of coordinate systems—including world, local, and camera-relative frames of reference—that define how objects are positioned, moved, and interacted with. Understanding these coordinate systems is fundamental to designing VR experiences that feel spatially coherent, responsive, and believable.

F02


Coordinate Systems in VR

In VR development, coordinate systems provide the framework for positioning, orienting, and scaling every element in your virtual world. A deep understanding of coordinate systems in VR is critical for creating immersive and technically robust experiences. By mastering the interplay between world, local, and view coordinate systems—and understanding how Unity’s left-handed system operates—you can ensure that every object in your virtual world is placed accurately and behaves consistently. Coordinate systems are essential for ensuring that virtual objects maintain their intended spatial relationships as the user moves. Accurate positioning and orientation of objects help the user feel grounded within a believable, interactive space, and proper management of coordinate systems minimizes errors like drift or scaling mismatches that can break immersion. Unity uses a left-handed coordinate system for its 3D space. Here’s a breakdown of how the axes are oriented:

  • X-axis: Represents horizontal movement, with the positive direction typically pointing to the right.
  • Y-axis: Represents vertical movement, with the positive direction pointing upwards.
  • Z-axis: Represents depth, with the positive direction typically pointing forward (out of the screen) in Unity’s left-handed coordinate system.

F01

Left-handed coordinate system uses the left hand for the axis orientation. Here, the positive Z axis points away from the viewer. Unity uses a left-handed system for its 3D world. This means when you specify a position like (X, Y, Z), the Z value increases as objects move away from the camera. Knowing your system’s handedness helps in importing assets, adjusting lighting, and ensuring proper camera behavior.


World Coordinate System

The world coordinate system is the global reference frame for the entire scene. It defines a fixed, universal orientation across the entire Unity environment. The world origin (0, 0, 0) is typically set near the player’s starting point or a defined central location in the virtual factory. This origin serves as the anchor point from which all objects’ positions, directions, and distances are ultimately measured. The world coordinate system uses a left-handed axis convention in Unity, where:

  • Positive X points right
  • Positive Y points up
  • Positive Z points forward (out of the screen)

These fixed world directions remain constant, regardless of an object’s orientation or parent-child relationships. This system ensures a consistent and shared spatial layout, enabling accurate placement, navigation, and alignment of objects throughout the scene.

01

In the logistics station, select a drone or scanner. Toggle between Global and Local handle modes in the Unity toolbar, then move the object using the Move tool (W). In Global mode, the arrows follow the fixed world axes (X: red, Y: green, Z: blue), while in Local mode, they align to the object’s current rotation. This clearly shows how world and local directions differ.


Local Coordinate System

Every GameObject in Unity also has a local coordinate system—its own frame of reference that travels and rotates with it. This system defines the object’s orientation and position relative to itself, rather than the world. Local axes are especially important when dealing with hierarchical relationships, such as child objects attached to a parent, or when animating complex, articulated mechanisms. In local space:

  • The X axis represents the object’s right direction
  • The Y axis represents the object’s up direction
  • The Z axis represents the object’s forward direction

These directions are influenced by the object’s rotation and are used in calculations like local movement, local rotation, and parenting. This makes local coordinates essential for precise control of movement and orientation, particularly in robotic arms, vehicles, characters, and modular machines. Note that Unity units are treated as meters in typical VR workflows.

02

In the exhibit station, select one of the leg joints on the quadruped robot (Spot). Use the Rotate tool (E) and toggle between Local and Global modes. When you rotate the joint in Local mode, the rotation follows the natural direction of the joint, consistent with the leg’s intended movement. In Global mode, the gizmo remains aligned with the world axes, making the rotation feel off or unnatural for articulated motion.


Camera Coordinate System

The camera (or headset) coordinate system is dynamic—it updates in real time with the user’s head position and orientation. In XR, the camera becomes the user’s point of view, serving as the basis for rendering the scene and positioning UI or interactive elements. Key spatial behaviors and scenarios include:

  • World-Locked Content: Objects are fixed in the environment and do not follow the user (i.e., the camera). Ideal for props, machines, landmarks, or spatial UI that needs to stay consistent as the user moves around. For example, the CNC machines in the manufacturing station remain anchored regardless of user movement.
  • Head-Locked (View-Fixed) Content: Objects move with the user’s head, maintaining a fixed offset in view space. Common for HUDs, notifications, or tooltips. Use sparingly to avoid motion sickness or visual overload.
  • Seated Experiences: The user is expected to stay seated. The world origin is usually aligned with the user’s initial head position, making camera-relative offsets predictable in limited physical space. This is suitable for simulations or control panels where physical movement is minimal.
  • Standing Experiences: The user stands and may walk or move within a physical play area. The world origin is aligned with the floor plane, and content should be positioned with physical scale and posture in mind. This is useful for interactive demos or exploring full-scale scenes like XFactory’s exhibit zone.
  • Hybrid Experiences: Some setups blend seated and standing interactions—for example, a user may stand to explore content but sit to operate a virtual machine. In XFactory’s exhibit station, users may stand to explore AR/VR displays but sit for testing simulations, requiring flexible origin handling.

F04

Drifts may happen as a result of gradual inaccuracies in the system’s understanding of position over time. Techniques such as periodic re-centering of the world origin help minimize drift. Regular calibration ensures that long-duration VR sessions maintain positional accuracy and prevent the feeling of disorientation.


Proxemics in VR

While coordinate systems define the logical structure of space, proxemics introduces the human dimension—how people perceive and react to spatial proximity. Proxemics is the study of personal space and social distance, and in virtual reality, it plays a crucial role in shaping interactions that feel natural, respectful, and emotionally comfortable. Designers must account not only for functional placement but also for the psychological boundaries users instinctively maintain. Respecting these spatial expectations can significantly enhance immersion and reduce discomfort. The zones of personal space in VR include:

  • Intimate Space (0–0.5m): Reserved for close personal interactions, such as handoffs, high-trust exchanges, or haptic feedback experiences. Avoid placing avatars, tools, or UI elements in this space unless the user has explicitly initiated the interaction.
  • Personal Space (0.5–1.5m): Ideal for one-on-one conversations, small-scale tasks, or interactive UI panels. This is the user’s primary comfort zone—frequently used for interaction and control, so intrusions should be intentional and minimal.
  • Social Space (1.5–4m): Best suited for group interactions, multiplayer collaboration, or shared environments. Arrange participants or elements to encourage communication while preserving personal boundaries.
  • Public Space (4m+): Appropriate for presentations, lectures, or passive observation. Use this zone for content delivery that doesn’t require direct engagement, such as signage, broadcasts, or performances.

F01

Designing with proxemics in mind ensures that your VR experiences are not only technically accurate—but also socially intuitive. Always test interactions at different distances and in varied user postures (e.g., standing, seated, crouching). Pay attention to how users respond to avatar proximity, reachability, and UI positioning. To reduce discomfort and maintain boundaries, consider subtle visual cues like fading, blurring, or scaling of objects that breach a user’s personal space. In XFactory, for example, invisible boundaries or warning overlays are essential around active machinery like CNC mills or robotic arms—balancing safety with immersion.


Locomotion in VR

Locomotion is the method by which a user moves through and interacts with a virtual environment. In VR, effective locomotion is critical to creating an immersive, natural, and comfortable experience. Unity’s XR Interaction Toolkit provides a range of locomotion primitives—including teleportation, snap turning, continuous turning, and continuous movement—that can be tailored to suit different applications. For beginner users start with teleportation + snap turn. Add continuous move/turn only when the task requires it, and always provide comfort settings or an alternative locomotion mode. Key considerations in designing VR locomotion include:

  • User Comfort and Safety: Design locomotion to minimize motion sickness and disorientation. Use snap turn and teleportation as safer defaults in dense factory scenes; tune move speed, turn amount, debounce time, vignette/tunneling, acceleration, and fade/transition effects when adding continuous locomotion. Some users cannot physically turn easily, while others are sensitive to artificial motion—locomotion options should remain configurable.
  • Centralized Input Handling and Interaction Safety: Favor action-based input through XRI Default Input Actions rather than device-specific bindings. The Locomotion Mediator coordinates locomotion requests, but snap turn and continuous turn should not both be enabled for the same user control at the same time.
  • Coordinate Space Management and Transformations: Precisely manage conversions between device, local, and world coordinate spaces. Accurate transformation is essential for maintaining spatial consistency, immersion, and aligning CAD assets, robot cells, controller-relative input, and teleport destinations.
  • Modularity, Scalability, and Flexibility in Movement: Build locomotion systems with modularity in mind using XRI Starter Assets and provider components. Teleport anchors can represent safe inspection points, machine stations, control panels, or training task positions, while continuous movement can support close inspection only when safety boundaries and collision geometry are respected.

F01

In XFactory, users can explore the factory floor to observe different stations. Continuous movement lets them walk beside a moving forklift, while teleportation allows them to quickly reposition near a drone landing pad or machinery entrance. Snap turning allows the user to interact with screens or robots placed in a circular formation without physical turning.


XR Origin and Locomotion

The XR Origin component and its root GameObject represent the tracked user in the scene. Locomotion providers move the XR Origin root so the camera and controllers remain spatially coherent. In your XFactoryVR scene, use the XR Origin (XR Rig) you copied from the VR Template SampleScene in D1—not a separate course-provided prefab. Unity may label this object XR Origin (XR Rig) or a similar XR Origin name; identify it by the active Main Camera, left/right controller or interactor child objects, and the locomotion setup beneath it. When locomotion runs—whether teleportation, continuous movement, or turning—providers update that root GameObject so the head (camera) and hands (controllers) stay aligned. The copied VR Template hierarchy typically resembles the structure below:

XR Origin (XR Rig)
├── Camera Offset
│   ├── Main Camera
│   ├── Gaze Interactor
│   ├── Left Controller
│   ├── Left Controller Teleport Stabilized Origin
│   ├── Right Controller
│   ├── Right Controller Teleport Stabilized Origin
│   ├── Left Hand
│   └── Right Hand
└── Locomotion
    ├── Turn
    ├── Move
    ├── Teleportation
    ├── Climb
    ├── Gravity
    └── Jump

XR Origin (XR Rig)

The root GameObject copied from the VR Template that encapsulates the tracked player setup. It is the main locomotion target, meaning that when teleportation or other movement occurs, providers (e.g., Teleportation Provider, Dynamic Move Provider) apply position and rotation changes directly here.

  • XR Origin: Defines the origin point for XR tracking, ensuring alignment of the player’s position and orientation with the real-world space.
  • Character Controller: Provides collision detection and physics-based constraints for the player (e.g., preventing walking through walls). It defines capsule height, radius, and step offset for grounded movement.
  • Input Action Manager: Handles input bindings by referencing the XRI Default Input Actions asset, which manages actions like movement, interaction, and teleportation across devices. Input actions must be enabled at runtime through this manager, Project-wide Actions, or the configured Starter Assets prefab setup.
  • XR Input Modality Manager: Manages the player’s current input mode (e.g., controller vs. hand tracking) and ensures the system dynamically switches input handling as needed.

Camera Offset

An intermediary transform that adjusts vertical alignment of the headset relative to the play area. It accounts for standing, seated, or room-scale setups.

  • Main Camera: Represents the user’s head. Driven by the physical headset, its position and rotation are critical for determining direction and teleportation destinations.
  • Left Controller / Right Controller: Represent the physical hand controllers. These often contain XR Ray Interactor or XR Direct Interactor, enabling pointing, grabbing, and teleport targeting.
  • Left Controller Teleport Stabilized Origin / Right Controller Teleport Stabilized Origin: Provide stable reference points for initiating teleport actions, helping reduce jitter or inconsistencies during teleport aiming.
  • Left Hand / Right Hand: Represent tracked hand visuals and hand-based interactors when hand tracking is enabled. Depending on the VR Template version, these may include poke interactors, hand rays, or other hand interaction components alongside—or instead of—controller-based input.

Locomotion

A collection of locomotion-related providers and behaviors that extend user movement beyond basic head tracking.

  • Turn: Enables snap or smooth turning of the XR Origin.
  • Move: Provides directional continuous movement controlled by the thumbstick.
  • Teleportation: Handles teleport-based locomotion using controller input.
  • Climb: Adds climbing mechanics for interactable climbable surfaces.
  • Gravity: Applies gravity to the XR Origin, ensuring grounded movement.
  • Jump: Allows the user to perform jump actions in supported environments.

Locomotion Components

Two key components—the Locomotion Mediator and the XR Body Transformer—work together to coordinate input-driven locomotion and apply it safely to the XR Origin.

  • Locomotion Mediator: The Locomotion Mediator mediates locomotion requests and provides locomotion providers with access to the linked XR Body Transformer. Multiple locomotion providers can coexist in XRI 3.x, but students should explicitly assign mediator and body transformer references in tutorials to make setup and debugging clearer. Providers can often auto-find the mediator if not assigned, but explicit wiring is more reliable for learning.
  • XR Body Transformer: The XR Body Transformer queues body transformations and applies them to the XR Origin during Update. Once a locomotion provider receives access through the mediator, it delegates movement operations to the XR Body Transformer. Transformation Priority controls queue/order for body transformations rather than acting as a general “only one provider in the whole scene” switch. This component must be present for the Locomotion Mediator to function correctly.

03

AI-generated XRI locomotion instructions often mix older Locomotion System, newer Locomotion Mediator, XR Rig naming, and manual input binding workflows. When locomotion fails, verify package version, Starter Assets, input action references, enabled actions, mediator/body transformer references, interaction layers, colliders, and OpenXR runtime settings before rewriting scripts.


Locomotion Providers

Locomotion providers are modular XRI components that implement specific movement behaviors—teleportation, snap turning, continuous turning, and continuous movement. Each provider requests locomotion through the Locomotion Mediator and applies transformations through the XR Body Transformer. In your copied VR Template setup under XR Origin (XR Rig), inspect or configure these providers in the Locomotion hierarchy. XRI also supports advanced options such as Teleportation Multi-Anchor Volume, but this session focuses on the core providers below.

  • Teleportation Provider: Moves the XR Origin instantly to a point on a Teleportation Area or Teleportation Anchor.
  • Snap Turn Provider: Rotates the user in fixed angular steps (for example, 45° or 90°) to reduce motion sickness.
  • Continuous Turn Provider: Rotates the XR Origin smoothly over time from thumbstick input.
  • Continuous Move Provider: Translates the user smoothly through the scene using a configured forward/movement source.
  • Dynamic Move Provider: Extends continuous movement with head- or controller-relative direction for forward, backward, and strafe travel.

Before starting this session, confirm that your D1 XFactoryVR scene contains the complete VR Template XR setup copied from SampleScene—including the XR Origin (XR Rig), Input Action Manager, XR Interaction Manager, locomotion objects, interactors, and enabled XRI Default Input Actions—and that OpenXR and interaction profiles are configured from D1.


Continuous Turn Provider

The Continuous Turn Provider rotates the XR Origin smoothly over time based on user input. While it offers a fluid rotation experience, it is less comfortable than snap turn for many users and must be carefully calibrated—overly rapid or prolonged turning can cause discomfort or motion sickness. Snap turn is usually the beginner/default comfort option; continuous turn is useful for specific applications but should be tuned carefully. A Tunneling Vignette Controller or equivalent comfort vignette can help reduce discomfort during smooth turning, but students should still test comfort in headset. Developers often tie this to the horizontal axis of the right-hand joystick and adjust turn speed to strike a balance between responsiveness and comfort. It is best used in open spaces where users need to orient themselves frequently without relying on teleportation. Follow the instructions below to set it up.

  1. Add a Continuous Turn Provider:
    • Right-click on the Locomotion GameObject and select Create Empty. Name the empty GameObject Turn.
    • In the Inspector, add the Continuous Turn Provider component to Turn.
    • In the Mediator field, assign the existing Locomotion Mediator component in the scene. This ensures the turning provider cooperates with other movement systems like teleportation or continuous movement.
    • Ensure the XR Body Transformer is also attached to the same GameObject as the XR Origin. It is responsible for applying the rotational changes generated by the turn provider.
  2. Configure Turning Parameters:
    • Transformation Priority: Set this to 0. It controls queue/order for body transformations relative to other providers.
    • Turn Speed: Set the speed of rotation in degrees per second (e.g., 60 for a smooth turning feel).
    • Enable Turn Left/Right: Check this box to allow the user to rotate left or right using the assigned input action (typically the thumbstick or trackpad). Disabling it will prevent lateral continuous turning.
    • Enable Turn Around: Check this box to enable a 180° turn input, allowing the user to quickly face the opposite direction. This is useful in fast-paced experiences where reorientation is needed.

    04

  3. Set Up Input Actions:
    • The Left Hand Turn Input and Right Hand Turn Input fields accept Value actions with Vector2 control type from XRI Default Input Actions. Each provider reads the relevant axis from that Vector2 input.
    • In the Continuous Turn Provider, click the circle (object picker) icon next to the Right Hand Turn Input field.
    • Choose the matching turn action from XRI Default Input Actions (for example, XRI RightHand Locomotion/Turn—names may vary slightly by Starter Assets version).
    • Repeat the above for the Left Hand Turn Input field if you want left-hand turning.

    05

  4. Run the Scene:
    • Enter Play mode and test with the XR Interaction Simulator, Quest Link / Meta Horizon Link (Windows), or an Android build on Quest as described above.
  5. Observe and Tune:
    • In the Scene view, watch the XR Origin rotate around its vertical axis (Y-axis) and verify it’s pivoting from the base.
    • Adjust the Turn Speed in the Continuous Turn Provider for more comfortable or responsive rotation.
    • Use Debug.Log("XR Origin Y-Rotation: " + transform.eulerAngles.y); to confirm that smooth turning functions independently of other locomotion methods like movement or teleportation. If rotation feels misaligned, verify the XR Origin’s structure and ensure input actions are assigned correctly and enabled through the Input Action Manager.

    If your setup already includes a Snap Turn Provider, disable the Continuous Turn Provider (and vice versa). Keep only one active turn provider at a time for the same user control.


Snap Turn Provider

The Snap Turn Provider rotates the XR Origin by a fixed angle—such as 45° or 90°—whenever a valid turn input is detected. Because it avoids smooth, continuous rotation, snap turning reduces visual motion and lowers the risk of motion sickness. It is especially useful in confined or object-dense environments like XFactory, where quick reorientation is needed without displacing the user. For most first-time VR users, snap turn plus teleportation is a safer default than continuous turn plus continuous movement. Snap turn is commonly paired with teleportation for maximum comfort and usability. Here is how it is set up.

  1. Add a Snap Turn Provider:
    • Select your Turn GameObject.
    • In the Inspector, add the Snap Turn Provider component.
    • Assign the existing Locomotion Mediator to the Mediator field to ensure that the snap turn provider integrates smoothly with other locomotion systems.
    • Confirm that an XR Body Transformer component is attached to the same GameObject as the XR Origin. This component handles the actual rotational transformation requested by the snap turn provider.

    If your setup already includes a Continuous Turn Provider, be sure to disable it. Only one turn provider should be active at a time to avoid conflicts between smooth and snap turning behaviors.

  2. Configure Snap Turn Parameters:
    • Transformation Priority: Set this to 0 unless another provider (like movement) needs to apply first. Lower values apply earlier in the transformation queue.
    • Turn Amount: Choose the angular step for each snap rotation. Typical values are 45 degrees (more granular) or 90 degrees (coarser, faster rotation).
    • Debounce Time: Set a delay (e.g., 0.5 seconds) between accepted inputs to avoid accidental rapid turning.
    • Delay Time: If visible in the Inspector, use this to delay the first turn—for example, to support a vignette transition.
    • Enable Turn Left Right: Enable it to allow left and right snap turns.
    • Enable Turn Around: Optionally enable this if you want to support a 180° turn action using a separate input. This is useful in tight or back-facing scenarios.

    08

  3. Assign Input Actions:
    • The provider includes Left Hand Turn Input and Right Hand Turn Input fields, each expecting a Value action with Vector2 control type from XRI Default Input Actions. The provider uses the relevant axis from that Vector2 input.
    • Click the circle (object picker) icon next to the Right Hand Turn Input field.
    • Choose the matching snap-turn action from XRI Default Input Actions (for example, XRI RightHand Locomotion/Snap Turn).
    • Leave the Left Hand Turn Input empty unless you wish to support turning via the left-hand joystick.

    09

  4. Run the Scene:
    • Enter Play mode and test with the XR Interaction Simulator, Quest Link / Meta Horizon Link (Windows), or an Android build on Quest as described above.
  5. Evaluate Snap Turn Behavior:
    • Use the joystick to perform snap turns and verify that the XR Origin rotates instantly by the set angle.
    • Observe whether the rotation happens cleanly around the XR Origin’s Y-axis and does not affect the camera height or controller offsets.
    • Adjust the Turn Amount for the right balance between speed and control based on your scene’s layout (e.g., tighter turns in small spaces).
  6. Refine Timing and Feedback:
    • If the turn feels too rapid or unintentional, increase the Debounce Time to filter out noise or over-triggering.
    • Optionally, add haptic feedback, sound effects, or UI flashes when a turn is performed to improve user awareness.
    • Visual cues—such as a directional arc or quick snap effect—can help users stay oriented after turning in environments with similar or repetitive geometry.

Dynamic Move Provider

The Dynamic Move Provider gradually translates the XR Origin in response to joystick input, allowing users to move smoothly through the virtual world. It extends continuous movement by choosing a movement frame of reference based on head or controller direction. This form of locomotion mimics real-world walking and enhances immersion, but it must be tuned carefully to avoid causing discomfort. Movement typically follows the headset’s facing direction and supports both forward and strafing (sideways) motion. It’s ideal for exploration-based applications where natural, fluid movement is critical. Follow the steps below to set it up.

  1. Attach the Dynamic Move Provider:
    • Right-click on the Locomotion GameObject and select Create Empty. Name the empty GameObject Move.
    • In the Inspector, add the Dynamic Move Provider component.
    • In the Mediator field, assign the existing Locomotion Mediator in the scene. This ensures the movement system cooperates with other locomotion providers like turning or teleportation.
    • Make sure the XR Body Transformer is attached to the same GameObject as the XR Origin. It applies the translation updates triggered by the move provider.
  2. Configure Movement Parameters:
    • Transformation Priority: Set this value to define when this movement is applied relative to other providers (e.g., after turning).
    • Move Speed: Set the speed of movement in units per second (e.g., 2.5 for walking pace).
    • Enable Strafe: Enable this to allow lateral (sideways) movement from joystick input.
    • Click the circle (object picker) icon next to the Left Hand Move Input field.
    • Choose the matching move action from XRI Default Input Actions (for example, XRI LeftHand Locomotion/Move). Move input uses Value actions with Vector2 control type (horizontal = strafe, vertical = forward/backward).
    • Repeat the input setup steps for the Right Hand Move Input field if needed.

    06

  3. Set Movement Direction:
    • For Dynamic Move Provider, assign the head and controller transforms used to determine movement direction. When using a plain Continuous Move Provider, the Forward Source controls which transform defines forward movement.
    • Head Transform: Assign the Main Camera to align movement direction with the user’s gaze.
    • Left Controller Transform: Assign the Left Controller to allow controller-relative input when needed.
    • Right Controller Transform: Assign the Right Controller for the same purpose on the right hand.
    • Left/Right Hand Movement Direction: Set this to Head Relative as the default beginner recommendation so that joystick inputs move the player relative to the user’s current viewing direction.

    07

  4. Run the Scene:
    • Enter Play mode and test with the XR Interaction Simulator, Quest Link / Meta Horizon Link (Windows), or an Android build on Quest as described above.
  5. Observe and Tune:
    • In the Scene view, move using the left-hand joystick and observe the XR Origin translating in space.
    • Confirm that forward movement matches the headset’s orientation and that the XR Origin moves at a comfortable speed.
    • Tweak Move Speed and Strafe settings for responsiveness and comfort.
    • Use Debug.Log("XR Origin Position: " + transform.position); to confirm that movement is applied in world space and correctly translates joystick input to the expected direction and magnitude. If movement appears off-angle, double-check that Head Transform and the per-hand movement direction settings are assigned correctly.

    Continuous movement is more likely than teleportation to cause discomfort. Start with slow speeds, avoid sudden acceleration, consider vignette comfort options, and provide teleportation as a fallback. If users should not pass through machines, walls, or safety boundaries, configure a Character Controller or constrained movement setup with colliders on the environment. Do not assume the XR Origin automatically collides with factory geometry. Avoid Rigidbody-based movement for the XR Origin.


Teleportation Provider

The Teleportation Provider receives teleport requests from teleportation interactables and moves the XR Origin to a chosen position in the virtual environment. This method avoids the sensory conflict caused by continuous movement, making it highly effective at minimizing motion sickness. It works with Teleportation Area and Teleportation Anchor interactables (and optionally advanced Teleportation Multi-Anchor Volume setups), and is typically triggered via an XR Ray Interactor on the controller. A Teleportation Area allows users to choose a point on a valid surface; a Teleportation Anchor sends users to a predefined position and optionally orientation. Teleportation is ideal for large environments, precision positioning, or setups where natural walking isn’t practical. To setup teleportation, follow the steps below.

  1. Add a Teleportation Provider:
    • Right-click on the Locomotion GameObject and select Create Empty. Name the empty GameObject Teleportation.
    • In the Inspector, add the Teleportation Provider component.
    • In the Mediator field, assign the Locomotion Mediator from your scene. This ensures teleportation integrates cleanly with other movement types.
    • Verify that the same GameObject also includes an XR Body Transformer. This component applies the actual transformation—teleporting the user from one location to another.
  2. Configure Teleportation Settings:
    • Transformation Priority: Set this to 0 to apply this movement before other providers.
    • Delay Time: Optionally delay teleport execution (e.g., for fade-out effects).

    10

  3. Assign Controller Input:
    • Select the controller you want to use for teleportation (e.g., Right Controller).
    • Ensure the GameObject or one of its children has an XR Ray Interactor component (e.g., in our case, Teleport Interactor GameObject).
    • Ensure the Interaction Layer Mask is set to Teleport so teleport targets are detected during setup and testing.
    • Starter Assets teleport interactors are usually already wired to XRI Default Input Actions. Verify the relevant Select Input and Activate Input references on the XR Ray Interactor only if teleport mode does not activate—for example, confirm teleport-mode activate and select/activate actions from the default action asset.

    11

  4. Set Up Teleportation Area:
    • Go to GameObject > XR > Teleportation Area to create a surface users can teleport to.
    • Resize and position the area to match your walkable regions (e.g., floors, platforms).
    • In the Teleportation Area component, set the Interaction Manager field if it is not already populated. Use the same XR Interaction Manager used elsewhere in your scene. You can leave this field empty as well—it will be populated in runtime.
    • Interaction Layer Mask: Defines which Interactors (e.g., ray, hand) can target this area based on matching interaction layers.
    • Colliders: The physical colliders that mark where teleporting is valid; must exist for raycasts/hits.
    • Distance Calculation Mode: Controls how “closest point” is measured for interaction (e.g., from interactor to surface hit).
    • Custom Reticle: Lets you assign a specific reticle prefab (visual marker) instead of using the default.
    • Select Mode: Determines how selection works (e.g., Single: one interactor at a time, Multiple: allow many).
    • Focus Mode: Defines how focus is tracked (e.g., whether multiple interactors can “focus”/hover at once).
    • Match Orientation: Aligns the player’s forward direction to the surface normal or target orientation when teleporting.
    • Teleport Trigger: Specifies the input event that actually executes the teleport (e.g., on select enter, on select release).
    • Materials: You can assign a custom material (e.g., transparent or semi-transparent) to the Mesh Renderer of the Teleportation Area to better match your scene’s visual style or to make teleport targets less visually intrusive.

    13

    Raise the Teleportation Area slightly above the floor on the positive Position Y axis (for example, 0.01–0.05 m) so its collider sits just above the floor geometry. This helps the teleport ray hit the area reliably instead of missing or conflicting with the floor mesh.

  5. Set Up Teleportation Anchor (Optional):
    • Add a fixed landing spot with a defined orientation via GameObject > XR > Teleportation Anchor.
    • Position and rotate the Teleportation Anchor to control where and how the user will face after teleporting.
    • In the Teleportation Anchor component, assign the Interaction Manager field using the same XR Interaction Manager copied from the VR Template setup (for example, from the scene root or under your XR Origin (XR Rig)). Click the circle icon to select it from the scene.
    • Set the Match Orientation dropdown based on how you want the user to be aligned after teleporting. None keeps the user’s current orientation. Target Up aligns only the vertical direction (Y-axis). Target Up And Forward aligns both vertical and forward directions to match the anchor’s transform.

    14

    • Optionally, you can replace the anchor with the Teleport Anchor prefab (provided by Unity) under Assets > XFactory > Prefabs > VR > Teleport to better visualize the position and direction of the teleportation anchor.

    16

  6. Run the Scene and Test Teleportation:
    • Enter Play mode and test with the XR Interaction Simulator, Quest Link / Meta Horizon Link (Windows), or an Android build on Quest as described above.
    • Aim the controller at a Teleportation Area or Anchor using the ray.
    • Press the assigned teleportation input (e.g., joystick forward, trigger hold).
    • Upon release or confirmation, the XR Origin should instantly move to the target location.
  7. Fine-Tune Interactions:
    • Adjust teleport behavior for instant versus press-and-hold activation.
    • Address interaction conflicts, such as grabbing and UI control—use separate layers and input actions to avoid overlap.
    • Test in a variety of lighting and environment conditions to ensure visual feedback remains visible and intuitive.
    • Make the teleportation area’s material transparent to make it less visually intrusive.

    In XFactory, use teleportation areas and anchors to guide users to safe inspection positions rather than letting them land inside machines, conveyors, robots, or blocked maintenance zones. Teleport anchors should represent safe inspection points, machine stations, control panels, or training task positions.


Locomotion Testing Checklist

Before moving on to optimization, verify the following in Play Mode and on device:

  • Head tracking works.
  • Controller tracking works.
  • Input actions are enabled through the Input Action Manager or Starter Assets setup.
  • Snap turn or continuous turn works, but not both on the same control at once.
  • Continuous move uses the intended forward source (Head Relative by default).
  • Teleport ray hits only valid teleport layers.
  • Teleport anchors face the intended direction.
  • XR Origin does not clip through floors, walls, or machines if collisions are required.
  • Quest Link / Meta Horizon Link preview works where available.
  • Android build-to-device works on Quest.
  • Comfort and scale are verified in headset.

Optimize the Project for VR

Before moving on to other VR topics in the course, pause here to review a short production checklist. The practices below apply to VR projects in general, not only to navigation; they help keep locomotion, interaction, and rendering comfortable on standalone headsets such as Meta Quest 3. 90 FPS is a common comfort target on many headsets, but actual budgets depend on Quest refresh rate, render scale, URP settings, foveated rendering support, lighting, shader complexity, post-processing, physics, and scene content. Poorly optimized VR apps can lead to nausea, discomfort, and system overheating, especially on standalone devices.


Measure Your Performance

  • Set a Target Frame Rate: Many VR headsets target 90 FPS or higher for comfort, but refresh-rate settings and device capabilities vary. Refer to your headset specifications (e.g., Meta Quest 3) and document a realistic target for your scene and course hardware.
  • Monitor Frame Rate Using Stats or Script: Click the Stats button in the top-right corner of the Game view to view real-time information such as FPS, draw calls, and triangle count. This is useful for early checks in the Editor. You can also display FPS in the scene using a simple script with 1.0f / Time.deltaTime, shown in a Text or TMP_Text UI element for live monitoring.

    17

  • Delve Deeper Into Performance Using Profiler: For a deeper look into CPU, GPU, memory, rendering, and script performance, open the Unity Profiler via Window > Analysis > Profiler. It provides real-time charts and timelines, helping you pinpoint bottlenecks while your application is running.

    18

  • Test on Device: Editor Stats are useful for early checks, but final performance decisions must be based on device testing with Unity Profiler, Android/Quest profiling tools, and in-headset observation. Build and run on your actual VR hardware. Long sessions can reveal thermal throttling that short Editor tests will not show.
  • Monitor Physics Cost: For locomotion and interaction-heavy scenes, monitor active rigidbodies, collision meshes, trigger volumes, and physics update cost.

Minimize Draw Calls

  • Check Draw Calls in Stats: Open the Game View > Stats window. The “Batches” value shows your draw call count. On standalone Quest testing, ~175 draw calls is a rough starting budget—not a universal rule. In the figure above, for example, the number of batches is over 300, which may be too high for standalone VR depending on scene content and render settings. High draw call counts increase CPU overhead and reduce frame rates, especially on mobile or standalone headsets.
  • Use Static Batching: Go to Edit > Project Settings > Player > Other Settings. Enable Static Batching. This feature lets Unity group static objects, reducing CPU work needed to send rendering instructions.

    19

  • Mark Static Objects: In the Hierarchy, select non-moving objects. In the Inspector, enable the Static checkbox to let Unity batch them. Marking objects as static informs the engine that these do not change, allowing more aggressive performance optimizations like lightmapping and occlusion culling. Only mark objects Static if they do not move, animate, or participate in dynamic interaction. In XFactory, static walls, floors, and large background machinery can be static; moving robots, forklifts, grabbable tools, doors, conveyors, and animated machine parts should not be blindly marked static.

Reduce Polygon Count

  • Analyze Triangle Count: In the Stats view, check Tris (triangle count). Use Scene View > Wireframe mode to inspect object complexity. On standalone Quest testing, ~500k triangles can serve as a rough starting budget, but acceptable limits depend on materials, lighting, and target hardware—not a fixed rule. Lower triangle counts reduce GPU load, making rendering faster and more efficient, particularly for scenes with many objects.
  • Inspect Meshes: Select objects and check their Mesh Filter in the Inspector. View the mesh in the Project window to see triangle details. Understanding your models’ complexity helps you spot and replace unnecessary high-poly meshes early in the pipeline.
  • Simplify High-Poly Assets: Use modeling tools like Blender or optimization tools like Simplygon to reduce polycounts. Use LOD Group components (GameObject > LOD Group) for objects that can have lower detail at distance. This helps maintain high visual quality up close while reducing rendering costs when objects are farther from the camera.

    20


Optimize Textures

  • Adjust Import Settings: Select textures in the Project view. In the Inspector, adjust Max Size, Format, and Compression. Smaller and compressed textures load faster, use less memory, and reduce the bandwidth needed for GPU rendering.
  • Enable Mip Maps: In the texture import settings, check Generate Mip Maps to reduce overdraw at distance. Mip maps improve performance and visual quality by lowering texture resolution for far-away objects, reducing aliasing.
  • Use Anisotropic Filtering: Set Aniso Level to 2–8 for floor or angled surfaces to improve sharpness at oblique views. This reduces blurring of textures viewed from shallow angles, such as factory floors or walls, enhancing realism.

    21


Optimize Particles and Effects

  • Simplify Particle Systems: Use Universal Render Pipeline/Particles/Unlit shaders for particles. Minimize particle count and lifetime. Complex particle systems are expensive and can tank performance quickly in VR; using unlit shaders avoids lighting overhead.
  • Limit Post-Processing Effects: Add a Volume to the Main Camera. Create and assign a Volume Profile. Use only lightweight effects like Color Adjustments or Bloom, and avoid Motion Blur, Chromatic Aberration, and Lens Distortion. Post-processing can dramatically impact performance and user comfort. Some effects are disorienting or nauseating in VR.

Apply Efficient Anti-Aliasing

  • Set MSAA in URP Asset: Locate your UniversalRenderPipelineAsset (e.g., URP-HighQuality). In the Inspector under Quality, set MSAA to 4x where supported. Multi-sample anti-aliasing is the preferred VR anti-aliasing path in URP and smooths jagged edges with a moderate performance cost, especially important for headset displays.

    22

  • Consider FXAA or SMAA as Alternatives: Depending on your pipeline and project settings, FXAA or SMAA can be lightweight screen-space alternatives. Do not assume FXAA/SMAA should always be combined with MSAA—choose based on visual quality needs and device performance.

    23

  • Adjust High-Detail Materials: For detailed objects like machines or robots, use baked Reflection Probes and simpler shaders. Real-time reflections and complex PBR shaders are GPU-intensive and should be avoided or simulated in VR contexts. Avoid motion blur, heavy lens distortion, chromatic aberration, and excessive post-processing in VR.


Additional Tips

  • Occlusion Culling: Open Window > Rendering > Occlusion Culling. Bake occlusion data to prevent rendering of objects blocked from view. This improves performance by skipping rendering for hidden geometry, especially useful in indoor scenes like XFactory.

    24

  • Lightmapping: Use Baked Lighting for static geometry and Mixed Lighting with Shadowmask for semi-dynamic objects. Baked lighting provides high visual fidelity at a fraction of the real-time lighting cost. To generate a lightmap, open the Lighting window (Window > Rendering > Lighting > Environment), scroll to the Lightmapping Settings section, and click Generate Lighting. Make sure your static objects are marked as Lightmap Static, and verify that Baked Global Illumination is enabled under Mixed Lighting for successful baking. Do not mark moving or interactive objects as lightmap static.

    25

  • Profiler Monitoring: In Window > Analysis > Profiler, use the Rendering tab to find bottlenecks such as Camera.Render, Shadows.Render, or PostProcessing.Render. Regular use of the Profiler helps catch performance issues early and guides your optimization decisions with real data.

    26


Key Takeaways

  • World, local, and camera coordinate systems explain why objects move and rotate the way they do in scene space.
  • Proxemics and safety envelopes help place content comfortably and responsibly around industrial equipment.
  • Locomotion uses the copied VR Template XR Origin (XR Rig), XRI Default Input Actions, the Locomotion Mediator, and comfort options such as teleportation and snap turn.
  • Configure locomotion on the copied template setup in XFactoryVR before adding custom movement logic to avoid conflicting input paths.
  • Performance work—mesh/texture optimization, batching, and on-device profiling—is part of usable VR navigation.