Skip to main content

AutoCamPlayer

A class in Root.Township, the global namespace.

Player controller for the auto camera mode: a camera that orbits and frames nearby players. AutoCamLocomotionController moves it, with keys to switch focus and change framing.

Constructors​

MemberWhat it is
AutoCamPlayer()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

9 private and internal fields
MemberWhat it is
private float cameraTiltBacking field for CameraTilt, in degrees.
private GameObject gameObjectToEnableOnLocalObject turned on only for the local player.
private float heightBufferBacking field for HeightBuffer.
private float lerpRotationBacking field for LerpRotation.
private float lerpSpeedBacking field for LerpSpeed.
private float maximumDistanceBacking field for MaximumDistance. Defaults to 30.
private float rotationSpeedBacking field for RotationSpeed.
private Camera topicBacking field for Topic, the camera this player drives.
private float widthBufferBacking field for WidthBuffer.

Properties​

MemberWhat it is
float CameraTilt { get; }Camera tilt angle in degrees.
override Transform Head { get; }The controller's own transform.
override Transform HeadFollow { get; }The controller's own transform.
float HeightBuffer { get; set; }Extra height kept around framed players. Page Up and Page Down scale it.
float LerpRotation { get; }Rotation lerp speed.
float LerpSpeed { get; }Position lerp speed.
float MaximumDistance { get; }Players within this distance of the focused one are framed too.
float RotationSpeed { get; set; }Orbit speed. Home and End change it.
Camera Topic { get; }The camera, used for field of view and aspect.
float WidthBuffer { get; set; }Extra width kept around framed players. Page Up and Page Down scale it.

Methods​

MemberWhat it is
protected override void Awake()Enables the local-only object once linked to the local player.
1 private and internal method
MemberWhat it is
private void OnLinkedToPlayer()When linked to the local player, enables gameObjectToEnableOnLocal.

Used in​

Members of other types that take, return or hold a AutoCamPlayer: