Camera¶
The Camera module allows you to configure the position, rotation, and other properties of your camera. Although pre-built cameras are accessible through Asset Library, they may not offer all the customization options you require. For instance, adjusting damping or enabling auto-recentering for a third-person camera may not be feasible with pre-built options. However, with the Camera module, you can create a camera to your liking and easily switch between different camera options.
Basic settings¶
Property | Description |
---|---|
Virtual camera name | The name of the new camera. Note: There are three built-in third-person camera modules: Default for the default game camera, Car for the default vehicle camera, and Gun for the default gun camera. If you specify any of these names as the Virtual camera name, you will replace the data for the corresponding built-in camera module. |
Cursor mode | Determines the method of controlling the view and cursor display when the camera is activated. Only works on PC platforms.
|
Camera mode | The mode of the new camera
|
Advanced settings | Toggles on to access additional camera settings, including projection, position, rotation, and other settings |
Projection settings¶
Property | Description |
---|---|
Perspective | Toggles on to render objects with perspective intact or toggles off to render objects uniformly. Enabled by default. |
FOV | Field of view. Ranges from 1 to 179. Default: 40. This option is only visible when Perspective is enabled. |
Position settings¶
Basic settings¶
Property | Description |
---|---|
Position details | Toggles to access position settings |
Min distance | The minimum distance that the camera moves along its z-axis to follow the target. Ranges from -1000 to 1000. Default: 1.3. This option is visible when Perspective is enabled and Camera mode is set to ThirdPerson or PlaneView. |
Max distance | The maximum distance that the camera moves along its z-axis to follow the target. Ranges from -1000 to 1000. Default: 5. This option is visible when Perspective is enabled and Camera mode is set to ThirdPerson or PlaneView. |
Default distance | The default distance the camera moves along its z-axis to follow the target. Ranges from -1000 to 1000. Default: 5. This option is visible when Perspective is enabled and Camera mode is set to ThirdPerson or PlaneView. |
Min OrthographicSize | The minimum half size of the vertical viewing volume of an orthographic camera. Ranges from -1000 to 1000. Default: 1.3. This option is visible when Perspective is disabled and Camera mode is set to ThirdPerson or PlaneView. |
Max OrthographicSize | The maximum half size of the vertical viewing volume of an orthographic camera. Ranges from -1000 to 1000. Default: 5. This option is visible when Perspective is disabled and Camera mode is set to ThirdPerson or PlaneView. |
Default OrthographicSize | The default half size of the vertical viewing volume of an orthographic camera. Ranges from -1000 to 1000. Default: 5. This option is visible when Perspective is disabled and Camera mode is set to ThirdPerson or PlaneView. |
Follow target | Determines the target for the camera to follow. Affects the position of the camera. This option is visible when Camera mode is set to ThirdPerson or PlaneView.
|
Reference target | Select a target whose position is used as a reference value for the camera's initial position. This option is only visible when Follow target is set to None.
|
Reference position | Provides a reference value for the camera's initial position. This option is only visible when Reference Target is set to None. |
Reference target entityId | Enter the unique identifier of the reference target. The entity ID can be found in Advanced Mode. This option is only visible when Reference target is set to TargetEntity. |
Follow target entityId | Enter the unique identifier of the entity to follow. The entity ID can be found in Advanced Mode. This option is only visible when Follow target is set to TargetEntity. |
Camera offset | The camera's position offset around the x-, y-, and z- axes in camera space |
Additional settings¶
Property | Description |
---|---|
Show extra position setting | Toggles on to access additional position settings |
Damping | Determines how rapidly the camera reacts to the target's movement in the x-, y-, and z- axes to maintain the offset. Ranges from 0 to 20 for each axis. The lower the value, the more responsive the camera is to the target's movement. |
Screen horizontal bias | Moves the target position horizontally away from the center of the screen. Ranges from 0 to 1. Default: 0.5. |
Screen vertical bias | Moves the target position vertically away from the center of the screen. Ranges from 0 to 1. Default: 0.5. |
Rotation settings¶
Basic settings¶
Property | Description |
---|---|
Rotation details | Toggles on to access rotation settings |
LookAt target | Determines the target for the camera to look at. Always keeping a target object in view affects the rotation of the camera and camera's collider (if physics is enabled). The option is only visible when Camera mode is set to ThirdPerson or Fix.
|
Reference euler | Provides reference value for the initial Euler angle of the camera. This option is visible only when LookAt target is set to None. |
LookAt target offset | The offset to be added to the position of the LookAt target in camera space. This option is visible when LookAt target is set to LocalPlayer or TargetEntity. |
LookAt target entityId | Enter the unique identifier of the entity to look at. The entity ID can be found in Advanced Mode. This option is visible only when LookAt target is set to TargetEntity. |
Euler offset | The offset around the x-, y-, and z- axes that the camera rotates in camera space |
Additional settings¶
Property | Description |
---|---|
Show extra rotation setting | Toggles on to access additional rotation settings |
Top angle limit | The top angle the vertical axis reaches. Ranges from -90 to 90. Default: 80. |
Bottom angle limit | The bottom angle the vertical axis reaches. Ranges from -90 to 90. Default: -80. |
Horizontal accel time | Determines the amount of time in seconds that it takes for the camera to accelerate to the built-in max speed on the horizontal axis. Ranges from 0 to 20. Default: 2. When the value is set to 0, it indicates that the horizontal input speed will accelerate at the same rate as the camera input, without any additional smoothing (lerping) applied. |
Horizontal decel time | Determines the amount of time in seconds that it takes for the camera to decelerate to 0 on the horizontal axis. Ranges from 0 to 20. Default: 0.25. When the value is set to 0, it indicates that the horizontal input speed will decelerate at the same rate as the camera input, without any additional smoothing (lerping) applied. |
Vertical accel Time | Determines the amount of time in seconds that it takes for the camera to accelerate to the built-in max speed on the vertical axis. Ranges from 0 to 20. Default: 2. When the value is set to 0, it indicates that the vertical input speed will accelerate at the same rate as the camera input, without any additional smoothing (lerping) applied. |
Vertical decel Time | Determines the amount of time in seconds that it takes for the camera to decelerate to 0 on the vertical axis. Ranges from 0 to 20. Default: 0.05. When the value is set to 0, it indicates that the vertical input speed will decelerate at the same rate as the camera input, without any additional smoothing (lerping) applied. |
Recenter time | Determines the amount of time in seconds that it takes for the camera to draw its forward axis close to the Follow target's forward axis once the target's position changes. Ranges from 0 to 20. When the value is set to 0, the recenter function is disabled. |
Other settings¶
Property | Description |
---|---|
Enable physics | Toggles on to enable the collider of the camera |
Audio listener offset | Adds an offset in camera space to the audio listener's position. The audio listener's position is calculated by adding the Follow target's position and the audio listener's offset in camera space. If there is no Follow target, its position is calculated by adding the camera's position and the audio listener's offset in camera space. |
NearFarClippingPlane | The near and far clipping planes of the camera's viewing frustum. The objects between the two clipping planes are visible in the camera’s view. By default, it's (0.2, 500, 0). |
Zoom controllable | Toggles on to enable user input to control zoom in or out. If enabled, the camera moves along its z-axis to follow the target. Disabled by default. |
Zoom sensitivity | Determines the rate at which the camera zooms in or out. Ranges from 0 to 20. Default: 1. This option is only visible when Zoom controllable is toggled on. |
View controllable | Toggles on to control the camera view when the player gives input |
View sensitivity | The speed at which the camera changes its view when the player gives input. Ranges from 0 to 20. Default: 1. This option is only visible when View controllable is toggled on. |
Note:
Here's how the position of a camera is calculated:
-
In ThirdPerson camera mode, the camera's runtime position is calculated by adding the Follow target's position and the camera distance multiplied by the Quaternion(RuntimeEuler) and Vector3.Back vectors. If there is no Follow target, the camera uses the reference position.
-
In PlaneView camera mode, the camera's runtime position is calculated by adding the Follow target's position, handle offset, and camera position multiplied by the Quaternion(RuntimeEuler) and Vector3.Back vectors. If there is no Follow target and View Controllable is enabled, the camera uses the reference position, handle offset, and camera distance multiplied by the Quaternion(RuntimeEuler) and Vector3.Back vectors. If View controllable is disabled, the camera uses the reference position only.
-
In Fixed camera mode, the camera's runtime position is always equal to the reference position.
-
In EntityControl camera mode, the camera's runtime position is the same as the attached object's transform position.
Built-in cameras¶
For the three built-in third-person cameras, you can see their properties below.
Default game camera named Default with the following settings:
A default gun camera will replace the game camera once the player is equipped with a gun. This camera is named Gun with the following settings:
A default vehicle camera will replace the game camera once the player gets on board vehicles, mostly sedans or sports cars. It is named Car with the following settings: