Class CinemachinePanTilt
This is a CinemachineComponent in the Aim section of the component pipeline. Its job is to aim the camera in response to the user's mouse or joystick input.
This component does not change the camera's position.
Inheritance
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[AddComponentMenu("Cinemachine/Procedural/Rotation Control/Cinemachine Pan Tilt")]
[DisallowMultipleComponent]
[CameraPipeline(CinemachineCore.Stage.Aim)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.cinemachine@3.1/manual/CinemachinePanTilt.html")]
public class CinemachinePanTilt : CinemachineComponentBase, IInputAxisOwner, IInputAxisResetSource, CinemachineFreeLookModifier.IModifierValueSource
Fields
PanAxis
Axis representing the current horizontal rotation. Value is in degrees and represents a rotation about the up vector
Declaration
[Tooltip("Axis representing the current horizontal rotation. Value is in degrees and represents a rotation about the Y axis.")]
public InputAxis PanAxis
Field Value
Type | Description |
---|---|
InputAxis |
RecenterTarget
Defines the recentering target: recentering goes here
Declaration
public CinemachinePanTilt.RecenterTargetModes RecenterTarget
Field Value
Type | Description |
---|---|
CinemachinePanTilt.RecenterTargetModes |
ReferenceFrame
Defines the reference frame against which pan and tilt rotations are made.
Declaration
public CinemachinePanTilt.ReferenceFrames ReferenceFrame
Field Value
Type | Description |
---|---|
CinemachinePanTilt.ReferenceFrames |
TiltAxis
Axis representing the current vertical rotation. Value is in degrees and represents a rotation about the right vector
Declaration
[Tooltip("Axis representing the current vertical rotation. Value is in degrees and represents a rotation about the X axis.")]
public InputAxis TiltAxis
Field Value
Type | Description |
---|---|
InputAxis |
Properties
IsValid
True if component is enabled and has a LookAt defined
Declaration
public override bool IsValid { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Stage
Get the Cinemachine Pipeline stage that this component implements. Always returns the Aim stage
Declaration
public override CinemachineCore.Stage Stage { get; }
Property Value
Type | Description |
---|---|
CinemachineCore.Stage |
Overrides
Methods
ForceCameraPosition(Vector3, Quaternion)
Force the virtual camera to assume a given position and orientation.
Procedural placement then takes over
Declaration
public override void ForceCameraPosition(Vector3 pos, Quaternion rot)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | pos | World-space position to take |
Quaternion | rot | World-space orientation to take |
Overrides
GetRecenterTarget()
Get the horizonmtal and vertical angles that correspong to "at rest" position.
Declaration
public Vector2 GetRecenterTarget()
Returns
Type | Description |
---|---|
Vector2 | X is horizontal angle (rot Y) and Y is vertical angle (rot X) |
MutateCameraState(ref CameraState, float)
Applies the axis values and orients the camera accordingly
Declaration
public override void MutateCameraState(ref CameraState curState, float deltaTime)
Parameters
Type | Name | Description |
---|---|---|
CameraState | curState | The current camera state |
float | deltaTime | Used for calculating damping. Not used. |
Overrides
OnTransitionFromCamera(ICinemachineCamera, Vector3, float)
Notification that this virtual camera is going live. Base class implementation does nothing.
Declaration
public override bool OnTransitionFromCamera(ICinemachineCamera fromCam, Vector3 worldUp, float deltaTime)
Parameters
Type | Name | Description |
---|---|---|
ICinemachineCamera | fromCam | The camera being deactivated. May be null. |
Vector3 | worldUp | Default world Up, set by the CinemachineBrain |
float | deltaTime | Delta time for time-based effects (ignore if less than or equal to 0) |
Returns
Type | Description |
---|---|
bool | True if the vcam should do an internal update as a result of this call |
Overrides
PrePipelineMutateCameraState(ref CameraState, float)
Does nothing
Declaration
public override void PrePipelineMutateCameraState(ref CameraState state, float deltaTime)
Parameters
Type | Name | Description |
---|---|---|
CameraState | state | ignored |
float | deltaTime | ignored |