Class CinemachineGroupFraming
An add-on module for Cinemachine Camera that adjusts the framing if the tracking target implements ICinemachineTargetGroup.
An attempt will be made to fit the entire target group within the specified framing. Camera position and/or rotation may be adjusted, depending on the settings.
Inheritance
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[AddComponentMenu("Cinemachine/Procedural/Extensions/Cinemachine Group Framing")]
[ExecuteAlways]
[RequiredTarget(RequiredTargetAttribute.RequiredTargets.GroupLookAt)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/CinemachineGroupFraming.html")]
public class CinemachineGroupFraming : CinemachineExtension
Fields
CenterOffset
A nonzero value will offset the group in the camera frame.
Declaration
[Tooltip("A nonzero value will offset the group in the camera frame.")]
public Vector2 CenterOffset
Field Value
Type | Description |
---|---|
Vector2 |
Damping
How aggressively the camera tries to frame the group. Small numbers are more responsive
Declaration
[Range(0, 20)]
[Tooltip("How aggressively the camera tries to frame the group. Small numbers are more responsive, rapidly adjusting the camera to keep the group in the frame. Larger numbers give a heavier more slowly responding camera.")]
public float Damping
Field Value
Type | Description |
---|---|
float |
DollyRange
Allowable range for the camera to move. 0 is the undollied position.
Negative values move the camera closer to the target.
Declaration
[Tooltip("Allowable range for the camera to move. 0 is the undollied position. Negative values move the camera closer to the target.")]
public Vector2 DollyRange
Field Value
Type | Description |
---|---|
Vector2 |
FovRange
Allowable FOV range, if adjusting FOV
Declaration
[Tooltip("Allowable FOV range, if adjusting FOV.")]
[MinMaxRangeSlider(1, 179)]
public Vector2 FovRange
Field Value
Type | Description |
---|---|
Vector2 |
FramingMode
What screen dimensions to consider when framing
Declaration
[Tooltip("What screen dimensions to consider when framing. Can be Horizontal, Vertical, or both")]
public CinemachineGroupFraming.FramingModes FramingMode
Field Value
Type | Description |
---|---|
CinemachineGroupFraming.FramingModes |
FramingSize
How much of the screen to fill with the bounding box of the targets.
Declaration
[Tooltip("The bounding box of the targets should occupy this amount of the screen space. 1 means fill the whole screen. 0.5 means fill half the screen, etc.")]
[Range(0, 2)]
public float FramingSize
Field Value
Type | Description |
---|---|
float |
LateralAdjustment
How to adjust the camera to get the desired horizontal and vertical framing
Declaration
[Tooltip("How to adjust the camera to get the desired horizontal and vertical framing.")]
public CinemachineGroupFraming.LateralAdjustmentModes LateralAdjustment
Field Value
Type | Description |
---|---|
CinemachineGroupFraming.LateralAdjustmentModes |
OrthoSizeRange
Allowable orthographic size range, if adjusting orthographic size
Declaration
[Tooltip("Allowable orthographic size range, if adjusting orthographic size.")]
public Vector2 OrthoSizeRange
Field Value
Type | Description |
---|---|
Vector2 |
SizeAdjustment
How to adjust the camera to get the desired framing
Declaration
[Tooltip("How to adjust the camera to get the desired framing size. You can zoom, dolly in/out, or do both.")]
public CinemachineGroupFraming.SizeAdjustmentModes SizeAdjustment
Field Value
Type | Description |
---|---|
CinemachineGroupFraming.SizeAdjustmentModes |
Methods
GetMaxDampTime()
Report maximum damping time needed for this extension. Only used in editor for timeline scrubbing.
Declaration
public override float GetMaxDampTime()
Returns
Type | Description |
---|---|
float | Highest damping setting in this extension |
Overrides
PostPipelineStageCallback(CinemachineVirtualCameraBase, Stage, ref CameraState, float)
Callback to tweak the settings
Declaration
protected override void PostPipelineStageCallback(CinemachineVirtualCameraBase vcam, CinemachineCore.Stage stage, ref CameraState state, float deltaTime)
Parameters
Type | Name | Description |
---|---|---|
CinemachineVirtualCameraBase | vcam | The virtual camera being processed |
CinemachineCore.Stage | stage | The current pipeline stage |
CameraState | state | The current virtual camera state |
float | deltaTime | The current applicable deltaTime |