Table of Contents

Class KCCCamera

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Third-person camera controller for character following, orbiting, zoom, and obstruction handling. Supports smooth movement, rotation, and framing adjustments.

public class KCCCamera : MonoBehaviour
Inheritance
Object
Component
Behaviour
MonoBehaviour
KCCCamera
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.CompareTag(TagHandle)
Component.transform
Component.transformHandle
Component.gameObject
Component.tag
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Fields

DefaultDistance

[Header("Distance")]
public float DefaultDistance

Field Value

float

DefaultVerticalAngle

Default vertical angle for camera.

[Range(-89, 89)]
public float DefaultVerticalAngle

Field Value

float

DistanceMovementSharpness

Sharpness for distance movement smoothing.

public float DistanceMovementSharpness

Field Value

float

DistanceMovementSpeed

Speed at which camera distance changes (zoom).

public float DistanceMovementSpeed

Field Value

float

FollowPointFraming

[Header("Framing")]
public Vector2 FollowPointFraming

Field Value

Vector2

FollowingSharpness

Sharpness for following movement (higher = snappier).

public float FollowingSharpness

Field Value

float

IgnoredColliders

Colliders to ignore when checking for obstructions.

public List<Collider> IgnoredColliders

Field Value

List<Collider>

InvertX

[Header("Rotation")]
public bool InvertX

Field Value

bool

InvertY

Invert vertical rotation input.

public bool InvertY

Field Value

bool

MaxDistance

Maximum allowed camera distance.

public float MaxDistance

Field Value

float

MaxVerticalAngle

Maximum vertical angle for camera.

[Range(-89, 89)]
public float MaxVerticalAngle

Field Value

float

MinDistance

Minimum allowed camera distance.

public float MinDistance

Field Value

float

MinVerticalAngle

Minimum vertical angle for camera.

[Range(-89, 89)]
public float MinVerticalAngle

Field Value

float

ObstructionCheckRadius

[Header("Obstruction")]
public float ObstructionCheckRadius

Field Value

float

ObstructionLayers

Layers to check for camera obstructions.

public LayerMask ObstructionLayers

Field Value

LayerMask

ObstructionSharpness

Sharpness for obstruction smoothing.

public float ObstructionSharpness

Field Value

float

RotateWithPhysicsMover

If true, camera rotates with physics mover.

public bool RotateWithPhysicsMover

Field Value

bool

RotationSharpness

Sharpness for rotation smoothing.

public float RotationSharpness

Field Value

float

RotationSpeed

Speed of camera rotation.

public float RotationSpeed

Field Value

float

Properties

FollowTransform

The transform the camera follows/orbits around.

public Transform FollowTransform { get; }

Property Value

Transform

PlanarDirection

The current planar (horizontal) direction of the camera.

public Vector3 PlanarDirection { get; set; }

Property Value

Vector3

TargetDistance

The target camera distance (zoom).

public float TargetDistance { get; set; }

Property Value

float

Transform

The camera's transform.

public Transform Transform { get; }

Property Value

Transform

Methods

SetFollowTransform(Transform)

Sets the transform that the camera will orbit/follow.

public void SetFollowTransform(Transform t)

Parameters

t Transform

The target transform to follow.

UpdateWithInput(float, float, Vector3)

Updates camera position and rotation based on input and deltaTime. Handles rotation, zoom, following, obstruction, and framing.

public void UpdateWithInput(float deltaTime, float zoomInput, Vector3 rotationInput)

Parameters

deltaTime float

Frame time.

zoomInput float

Zoom input value.

rotationInput Vector3

Rotation input vector.