FlyCamLocomotionController
A class in Root.Township, the global namespace.
Moves the fly cam from keyboard, mouse and gamepad, with optional cinematic smoothing, and handles its hotkeys. Movement runs on the local player and is streamed.
- Listed in Global namespace: E to H
- Inherits or implements
LocomotionController - Nested types
SenseSetupSet
Constructors
| Member | What it is |
|---|---|
FlyCamLocomotionController() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
16 private and internal fields
| Member | What it is |
|---|---|
private TeleporterTrailLerper activeTrail | Trail currently shown to other players. |
private MethodSync changeSenses | Method sync sent by ; or d-pad down to cycle senses. |
private FlyCamInput flyCamInput | Fly cam input actions, local player only. |
private QuickAccessMenuAction micMuteAction | Quick action run by M. |
private QuickAccessMenuAction modsMicMuteAction | Quick action run by Shift+M. |
private bool pressedDown | Edge state for d-pad down. |
private bool pressedSides | Edge state for d-pad left and right (sensitivity change). |
private bool pressedUp | Edge state for d-pad up (cinematic toggle). |
private int selectedDirection | Gamepad stick-click speed mode: 1 fast, -1 slow, 0 normal. |
private int senseIndex | Index of the current sense setup. |
private FlyCamLocomotionController.SenseSetupSet[] senseSetups | Sense setups cycled by ChangeSense. |
private QuickAccessMenuAction showNamesAction | Quick action run by N. |
private Vector3 smoothInputMovement | Smoothed move input for cinematic mode. |
private Vector2 smoothInputRotation | Smoothed look input for cinematic mode. |
private Target target | AI target registered only while the fly cam is set as alive. |
private PooledObjectDefinition trail | Pooled trail shown to other players when the fly cam is visible. |
Properties
| Member | What it is |
|---|---|
protected FlyCamPlayer PlayerController { get; } | The owning FlyCamPlayer. |
Methods
| Member | What it is |
|---|---|
override void Initialize() | Turns on streaming and sets up the sense change sync. |
override void InitializeAsServer(SpawnData spawnData) | Server: applies the current sense setup to the fly cam's AI target. |
protected override void Update() | Local player: reads look, move and climb input, applies speed modifiers and smoothing, and handles d-pad and key shortcuts. |
7 private and internal methods
| Member | What it is |
|---|---|
private void ChangeSense(IPlayer player, Stream stream) | Sync handler: cycles to the next sense setup and toggles whether AI can target the fly cam. |
private void CleanTrail(NetworkEntity entity, bool isUnload) | Releases the trail when the entity is destroyed by the scene. |
private bool GetKey(Key key) | True while a keyboard key is held. False with no keyboard. |
private bool GetKeyDown(Key key) | True on the frame a keyboard key is pressed. False with no keyboard. |
private void OnValidate() | Fixes up every sense setup in the inspector. |
private void Start() | Marks the fly cam not alive and hidden from AI; sets up input on the local player or the trail for remote viewers. |
private void UpdateVisibility(bool isVisible) | Remote clients: shows or removes the trail when the fly cam's visibility changes. |