Adventure Creator  1.76.2
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.GameCameraThirdPerson Class Reference
Inheritance diagram for AC.GameCameraThirdPerson:

Public Types

enum  InitialDirection {
  BehindTarget, PreviousCameraSpin, PreviousCameraDirection, PreviousCameraRelativePosition,
  SetAngles, None
enum  ZoomMethod { None, AxisControlsDistance, ButtonControlsFOV }

Public Member Functions

void SetTarget (Transform target)
void SetLookAtOverride (Transform lookAtOverride, float transitionTime)
void ClearLookAtOverride (float transitionTime=0f)
bool IsLookAtInfluenceComplete ()
void SnapToCurrentCamera (bool fromRelativePosition=false)
void SnapToCurrentCameraSpin (float newPitchAngle=10f)
void SnapToDirection (Vector3 forward, Vector3 right)
void SnapToRotation (float newSpinAngle, float newPitchAngle, bool spinIsRelativeToTarget=false)
void SnapBehindTarget (float newDistance=0f)
Vector2 GenerateTargetAngles (Transform transform)
void BeginAutoMove (float speed, Vector2 targetAngles, bool relativeToTarget)
bool IsAutoMoving ()
void SetInitialDirection ()
void ShowGUI ()
- Public Member Functions inherited from AC._Camera
virtual Vector2 CreateRotationOffset ()
 Returns a vector by which to tweak the camera's rotation. The x-axis will control the spin, and the y-axis will control the pitch. More...
virtual void SwitchTarget (Transform _target)
 Switches the camera's target. More...
virtual bool Is2D ()
 Checks if the camera is for 2D games. This is necessary for working out if the MainCamera needs to change its projection matrix. More...
virtual void _Update ()
virtual void ResetTarget ()
virtual void MoveCameraInstant ()
void SetSplitScreen ()
void RemoveSplitScreen ()
virtual Vector2 GetPerspectiveOffset ()
 Gets the actual horizontal and vertical panning offsets. More...
bool IsActive ()
 Checks if the Camera is currently the MainCamera's active camera (attachedCamera) More...
void MakeActive ()

Public Attributes

string spinAxis = "CursorHorizontal"
string pitchAxis = "CursorVertical"
bool requireLockedCursor = false
bool allowCutsceneControl = false
bool allowConversationControl = false
Vector2 intialDirectionAngles =
InitialDirection initialDirection = InitialDirection.BehindTarget
bool initialOnSwitch = false
Vector2 inputInfluence = new Vector2 (3f, 3f)
Vector2 maxInput = new Vector2 (3f, 3f)
float fastDistanceFactor = 2f
float distanceAcceleration = 5f
float distanceInfluenceAcceleration = 10f
bool targetMovementInfluencesSpin = true
float targetSpinAcceleration = 2f
float targetSpinInfluence = 1f
float targetSpinDelay = 2f
float edgeCurvature = 0f
bool targetMovementInfluencesPitch = true
float targetPitchInfluence = 1f
float targetPitchRestAngle = 0f
float pitchAcceleration = 8f
float minPitch = -80f
float maxPitch = 80f
bool doLimitSpin = false
float minSpin = -80f
float maxSpin = 80f
float spinLimitOffset = 0f
float spinAcceleration = 8f
float heightOffset = 0f
float horizontalOffset = 0f
bool detectCollisions = true
LayerMask collisionLayerMask = new LayerMask ()
float minimumDistance = 0.2f
float wallSeparator = 0.1f
float heightChangeInfluenceLimit = 10f
float maxRaycastDistance = 5f
float zoomLimit = 0.5f
string zoomAxis = "Mouse ScrollWheel"
float zoomSpeed = 1f
ZoomMethod zoomMethod = ZoomMethod.None
Vector2 inputSmoothing = new Vector2 (0.3f, 0.3f)
bool focalPointIsTarget = true
- Public Attributes inherited from AC._Camera
bool targetIsPlayer = true
Transform target
bool isDragControlled = false
float focalDistance = 10f

Protected Member Functions

override void OnEnable ()
override void OnDisable ()
override void Start ()
- Protected Member Functions inherited from AC._Camera
virtual void Awake ()
Vector3 PositionRelativeToCamera (Vector3 _position)
Vector3 RightVector ()
Vector3 ForwardVector ()
float ConstrainAxis (float desired, Vector2 range, bool isAngle=false)


float SpinAngle [get]
float PitchAngle [get]
Transform LookAtOverride [get]
- Properties inherited from AC._Camera
Transform Target [get]
Transform CameraTransform [get]
Transform Transform [get]
Camera Camera [get]
bool isFor2D [get, set]
virtual TransparencySortMode TransparencySortMode [get]
Vector3 TargetForward [get]
virtual bool CursorOffsetForcesTranslation [get]

Additional Inherited Members

- Protected Attributes inherited from AC._Camera
Char targetChar
Camera _camera
Vector2 inputMovement
bool is2D = false

Member Data Documentation

◆ allowConversationControl

bool AC.GameCameraThirdPerson.allowConversationControl = false

If True, then spin and pitch can be altered when a Conversation is active

◆ allowCutsceneControl

bool AC.GameCameraThirdPerson.allowCutsceneControl = false

If True, then spin and pitch can be altered when gameplay is blocked

◆ collisionLayerMask

LayerMask AC.GameCameraThirdPerson.collisionLayerMask = new LayerMask ()

The LayerMask used to detect collisions, if detectCollisions = True

◆ detectCollisions

bool AC.GameCameraThirdPerson.detectCollisions = true

If True, then the camera will detect Colliders to try to avoid clipping through walls

◆ distanceAcceleration

float AC.GameCameraThirdPerson.distanceAcceleration = 5f

Acceleration when changing distance

◆ distanceInfluenceAcceleration

float AC.GameCameraThirdPerson.distanceInfluenceAcceleration = 10f

The acceleration when changing distance due to the target's speed

◆ doLimitSpin

bool AC.GameCameraThirdPerson.doLimitSpin = false

If True, then the spin angle is constrained

◆ edgeCurvature

float AC.GameCameraThirdPerson.edgeCurvature = 0f

The amount of curvature in the corners when the spin angle is constrained

◆ fastDistanceFactor

float AC.GameCameraThirdPerson.fastDistanceFactor = 2f

How much that target's speed influences distance

◆ focalPointIsTarget

bool AC.GameCameraThirdPerson.focalPointIsTarget = true

If True, then focalDistance will match the distance to target

◆ heightChangeInfluenceLimit

float AC.GameCameraThirdPerson.heightChangeInfluenceLimit = 10f

The limit to which changes in the target's height influence the pitch angle

◆ heightOffset

float AC.GameCameraThirdPerson.heightOffset = 0f

The global offset to apply to all height values

◆ horizontalOffset

float AC.GameCameraThirdPerson.horizontalOffset = 0f

An offset to apply to the camera's horizontal position. The Camera must be a child of this component for the effect to work

◆ initialDirection

InitialDirection AC.GameCameraThirdPerson.initialDirection = InitialDirection.BehindTarget

How to set the original direction (BehindTarget, PreviousCameraSpin, PreviousCameraDirection, PreviousCameraRelativePosition, SetAngles, None)

◆ initialOnSwitch

bool AC.GameCameraThirdPerson.initialOnSwitch = false

If True, the camera will revert to its initial direction each time it is switched to

◆ inputInfluence

Vector2 AC.GameCameraThirdPerson.inputInfluence = new Vector2 (3f, 3f)

The influence that input has on motion (X = spin, Y = pitch)

◆ inputSmoothing

Vector2 AC.GameCameraThirdPerson.inputSmoothing = new Vector2 (0.3f, 0.3f)

The factor by which the camera accelerates due to input

◆ intialDirectionAngles

Vector2 AC.GameCameraThirdPerson.intialDirectionAngles =

The direction to face by default

◆ maxInput

Vector2 AC.GameCameraThirdPerson.maxInput = new Vector2 (3f, 3f)

The maximum amount of input per-frame (X = spin, Y = pitch)

◆ maxPitch

float AC.GameCameraThirdPerson.maxPitch = 80f

The maximum pitch angle

◆ maxRaycastDistance

float AC.GameCameraThirdPerson.maxRaycastDistance = 5f

The distance of rays used to detect collisions

◆ maxSpin

float AC.GameCameraThirdPerson.maxSpin = 80f

The maximum spin angle, if doLimitSpin = True

◆ minimumDistance

float AC.GameCameraThirdPerson.minimumDistance = 0.2f

The minimum distance to keep from its target, if detectCollisions = True

◆ minPitch

float AC.GameCameraThirdPerson.minPitch = -80f

The minimum pitch angle

◆ minSpin

float AC.GameCameraThirdPerson.minSpin = -80f

The minimum spin angle, if doLimitSpin = True

◆ pitchAcceleration

float AC.GameCameraThirdPerson.pitchAcceleration = 8f

The acceleration of pitch rotations

◆ pitchAxis

string AC.GameCameraThirdPerson.pitchAxis = "CursorVertical"

The name of the Input axis that controls pitch rotation, if isDragControlled = False

◆ requireLockedCursor

bool AC.GameCameraThirdPerson.requireLockedCursor = false

If true, then the cursor must be locked before input will take effect

◆ spinAcceleration

float AC.GameCameraThirdPerson.spinAcceleration = 8f

The acceleration of spin rotations

◆ spinAxis

string AC.GameCameraThirdPerson.spinAxis = "CursorHorizontal"

The name of the Input axis that controls spin rotation, if isDragControlled = False

◆ targetMovementInfluencesPitch

bool AC.GameCameraThirdPerson.targetMovementInfluencesPitch = true

If True, the target's movement influenced the pitch angle

◆ targetMovementInfluencesSpin

bool AC.GameCameraThirdPerson.targetMovementInfluencesSpin = true

If True, the target's movement influenced the spin angle

◆ targetPitchInfluence

float AC.GameCameraThirdPerson.targetPitchInfluence = 1f

The amount by which the target's movement influences the pitch angle

◆ targetPitchRestAngle

float AC.GameCameraThirdPerson.targetPitchRestAngle = 0f

The pitch angle to move towards when influenced by the target's movement

◆ targetSpinDelay

float AC.GameCameraThirdPerson.targetSpinDelay = 2f

How long the target can move before they influence the spin angle

◆ targetSpinInfluence

float AC.GameCameraThirdPerson.targetSpinInfluence = 1f

The amount by which the target's movement influences the spin angle

◆ wallSeparator

float AC.GameCameraThirdPerson.wallSeparator = 0.1f

The distance to keep from walls, if detectCollisions = True;

◆ zoomAxis

string AC.GameCameraThirdPerson.zoomAxis = "Mouse ScrollWheel"

The axis that controls zooming

◆ zoomLimit

float AC.GameCameraThirdPerson.zoomLimit = 0.5f

The lower relative limit to zooming

◆ zoomMethod

ZoomMethod AC.GameCameraThirdPerson.zoomMethod = ZoomMethod.None

The method by which to allow zooming (None, AxisControlsDistance, ButtonControlsFOV)

◆ zoomSpeed

float AC.GameCameraThirdPerson.zoomSpeed = 1f

The speed of zooming