This site has been permanently archived. The content on this site was last updated in 2019.
Chase camera
Stay organized with collections
Save and categorize content based on your preferences.

The Chase Camera demo demonstrates a type of third-person locomotion in a VR
environment. The player can direct a character around the scene using the
pointer. For short distances, the camera will remain still. For longer
distances, the camera will follow behind the main character. Chase Camera also
uses tunneling for horizontal and rotational
movements to reduce motion sickness.
Getting started
Adding Chase Camera to your scene requires two things:
- Drag the
ChaseCamPlayer
Prefab into your scene.
- Assign the Chase Character property to the main character.
Customization
Chase Camera is designed to be customized. You can adjust
the camera controls, the pointer and target visualization, and the main character
to meet your app's needs.
Camera controls
ChaseCamPlayer
manages camera behavior and is configured with a default camera
configuration. It offers a number of settings you can customize to your use
case.
- Bounding Radius: Movement within the Bounding Radius will not cause the camera to move.
- Trailing Offset: The offset the camera will try to maintain from the chase
character. If the character moves outside the bounding radius,
the camera will animate with the character to maintain this offset position.
- Movement Speed: The speed of the camera when it respositions itself when the chase
character moves outside the bounding radius.
- Rotation: You can optionally disable rotation through a checkbox on the component.
It is controlled by 2 triggers (left and right rotate).
Pointer and target visualization
The Chase Camera demo comes with a pointer system for directing the main character
around the scene. This is optional can be customized
in ChaseCamPlayer/Pointer/Laser. You can adjust the Target Prefab property
to change the target at the end of the laser. You can also adjust the laser colors.
You can also create your own pointer system, as long as you call into
SetTargetPosition()
on the BasePositionedCharacter
. Calling this method
internally notifies the chase camera to follow the character.
Main character
The Chase Camera demo comes with its own character that can be further customized or even swapped out.
For characters that use CharacterController
and move about on the ground, you
can can subclass GroundPositionCharacter
. If your character doesn't use
CharacterController
or you don't want them to be acted on by gravity, such a
flying character, you can subclass the more general BasePositionCharacter
class instead.
For an example you can look at FoxPositionCharacter
, the class that controls
the provided fox character. Note that the only additional information this
subclass as over GroundPositionCharacter
is the animations associated with the
fox.
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["\u003cp\u003eChase Camera enables third-person locomotion in VR using a pointer for character navigation and camera following.\u003c/p\u003e\n"],["\u003cp\u003eThe camera follows the character for longer distances and remains stationary for shorter distances within a defined bounding radius.\u003c/p\u003e\n"],["\u003cp\u003eChase Camera utilizes tunneling for horizontal and rotational movements to minimize motion sickness.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize camera controls, pointer visualization, and character settings to fit their VR application's needs.\u003c/p\u003e\n"],["\u003cp\u003eTwo main character base classes are provided for grounding characters and flying/non-grounded characters to build upon.\u003c/p\u003e\n"]]],["The Chase Camera demo uses a third-person perspective in VR. Key actions include dragging the `ChaseCamPlayer` prefab into the scene and assigning the main character. The camera stays still for short movements but follows for longer ones, employing tunneling to mitigate motion sickness. Customization options include adjusting camera controls (bounding radius, trailing offset, speed, and rotation), the pointer/target visualization, and the main character, through subclasses like `GroundPositionCharacter` or `BasePositionCharacter`. A pointer system with customizable target and colors is also included.\n"],null,["# Chase camera\n\nThe Chase Camera demo demonstrates a type of third-person locomotion in a VR\nenvironment. The player can direct a character around the scene using the\npointer. For short distances, the camera will remain still. For longer\ndistances, the camera will follow behind the main character. Chase Camera also\nuses [tunneling](/vr/elements/tunneling) for horizontal and rotational\nmovements to reduce motion sickness.\n\nGetting started\n---------------\n\nAdding Chase Camera to your scene requires two things:\n\n1. Drag the `ChaseCamPlayer` Prefab into your scene.\n2. Assign the **Chase Character** property to the main character.\n\n### Customization\n\nChase Camera is designed to be customized. You can adjust\nthe camera controls, the pointer and target visualization, and the main character\nto meet your app's needs.\n\n#### Camera controls\n\n`ChaseCamPlayer` manages camera behavior and is configured with a default camera\nconfiguration. It offers a number of settings you can customize to your use\ncase.\n\n- **Bounding Radius**: Movement within the Bounding Radius will not cause the camera to move.\n- **Trailing Offset**: The offset the camera will try to maintain from the chase character. If the character moves outside the bounding radius, the camera will animate with the character to maintain this offset position.\n- **Movement Speed**: The speed of the camera when it respositions itself when the chase character moves outside the bounding radius.\n- **Rotation**: You can optionally disable rotation through a checkbox on the component. It is controlled by 2 triggers (left and right rotate).\n\n#### Pointer and target visualization\n\nThe Chase Camera demo comes with a pointer system for directing the main character\naround the scene. This is optional can be customized\nin ChaseCamPlayer/Pointer/Laser. You can adjust the **Target Prefab** property\nto change the target at the end of the laser. You can also adjust the laser colors.\n\nYou can also create your own pointer system, as long as you call into\n`SetTargetPosition()` on the `BasePositionedCharacter`. Calling this method\ninternally notifies the chase camera to follow the character.\n\n#### Main character\n\nThe Chase Camera demo comes with its own character that can be further customized or even swapped out.\nFor characters that use `CharacterController` and move about on the ground, you\ncan can subclass `GroundPositionCharacter`. If your character doesn't use\n`CharacterController` or you don't want them to be acted on by gravity, such a\nflying character, you can subclass the more general `BasePositionCharacter`\nclass instead.\n\nFor an example you can look at `FoxPositionCharacter`, the class that controls\nthe provided fox character. Note that the only additional information this\nsubclass as over `GroundPositionCharacter` is the animations associated with the\nfox."]]