Skip to main content

AutoCamLocomotionController

A class in Root.Township, the global namespace.

Locomotion for the AutoCam spectator camera: orbits slowly around a focused player and frames every player near them, with keyboard controls. Local player only.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private float currentRotationCurrent orbit angle in radians, increased by the rotation speed each frame.
private int focusIndex of the player being followed.
private List<AutoCamLocomotionController.AutoCamTarget> targetsPlayer body transforms gathered this frame, with whether each is close enough to the focus to be framed.

Properties​

1 private and internal property
MemberWhat it is
private AutoCamPlayer PlayerController { get; }The controller as an AutoCamPlayer, which holds the framing settings.

Methods​

1 private and internal method
MemberWhat it is
private void LateUpdate()Collects all player bodies, handles keys (arrows change focus, PageUp/PageDown zoom, Home/End orbit speed, Backspace cursor) and lerps the camera to frame them.