Show / Hide Table of Contents

Class OrbitalCameraSystem

The main script in the OrbitalCam system. Holds most of the properties that can be tweaked, and is the endpoint for communication with the Public API.

Inheritance
object
Object
Component
Behaviour
MonoBehaviour
OrbitalCameraSystem
Namespace: Goehler.IO.OrbitalCam
Assembly: Assembly-CSharp.dll
Syntax
[AddComponentMenu("Goehler Studios/Orbital Cam/Orbital Camera System")]
public class OrbitalCameraSystem : MonoBehaviour

Properties

InvertMouseAndTouchRotation

Toggle this to invert the horizontal rotation of both mouse and touch gestures.

Declaration
public bool InvertMouseAndTouchRotation { get; set; }
Property Value
Type Description
bool

This value can be set via the inspector or at runtime.

InvertMousendTouchTilt

Toggle this to invert the vertical tilt of both mouse and touch gestures.

Declaration
public bool InvertMousendTouchTilt { get; set; }
Property Value
Type Description
bool

This value can be set via the inspector or at runtime.

MouseMovementButton

Pick a mouse button to be used for movement.

Declaration
public MouseButton MouseMovementButton { get; set; }
Property Value
Type Description
MouseButton

This value can be set via the inspector or at runtime.

MouseRotationAndTiltButton

Pick a mouse button to be used for rotation and tilt.

Declaration
public MouseButton MouseRotationAndTiltButton { get; set; }
Property Value
Type Description
MouseButton

This value can be set via the inspector or at runtime.

ShowRaycasts

For debugging purposes. Toggle this on to see the rays used for the height adjustment calculations in the game view.

Declaration
public bool ShowRaycasts { get; }
Property Value
Type Description
bool

This value can only be set via the inspector.

TerrainLayerMask

The layer mask controlling which objects the raycasts will collide with, while determining the height of the terrain.

Declaration
public LayerMask TerrainLayerMask { get; }
Property Value
Type Description
LayerMask

This value can only be set via the inspector.

TouchMovementGesture

Pick a touch gesture to be used for movement.

Declaration
public TouchGesture TouchMovementGesture { get; set; }
Property Value
Type Description
TouchGesture

This value can be set via the inspector or at runtime.

TouchRotationAndTiltGesture

Pick a touch gesture to be used for rotation and tilt.

Declaration
public TouchGesture TouchRotationAndTiltGesture { get; set; }
Property Value
Type Description
TouchGesture

This value can be set via the inspector or at runtime.

UseEdgeScrollingForMovement

Toggle this on to move the camera when the pointer gets close to the edge of the screen.

Declaration
public bool UseEdgeScrollingForMovement { get; set; }
Property Value
Type Description
bool

This value can be set via the inspector or at runtime.

UseMouseForMovement

Toggle this on to use the mouse for movement. Drag the ground to move arund.

Declaration
public bool UseMouseForMovement { get; set; }
Property Value
Type Description
bool

This value can be set via the inspector or at runtime.

UseMouseForRotation

Toggle this on to use the mouse for horizontal rotation around the target.

Declaration
public bool UseMouseForRotation { get; set; }
Property Value
Type Description
bool

This value can be set via the inspector or at runtime.

UseMouseForTilt

Toggle this on to use the mouse for vertical tilt around the target.

Declaration
public bool UseMouseForTilt { get; set; }
Property Value
Type Description
bool

This value can be set via the inspector or at runtime.

UseMouseWheelForZoom

Toggle this on to use the mouse wheel for zooming.

Declaration
public bool UseMouseWheelForZoom { get; set; }
Property Value
Type Description
bool

This value can be set via the inspector or at runtime.

UseTouchForMovement

Toggle this on to use touch for movement. Drag the ground to move arund.

Declaration
public bool UseTouchForMovement { get; set; }
Property Value
Type Description
bool

This value can be set via the inspector or at runtime.

UseTouchForRotation

Toggle this on to use touch for horizontal rotation around the target.

Declaration
public bool UseTouchForRotation { get; set; }
Property Value
Type Description
bool

This value can be set via the inspector or at runtime.

UseTouchForTilt

Toggle this on to use touch for vertical tilt around the target.

Declaration
public bool UseTouchForTilt { get; set; }
Property Value
Type Description
bool

This value can be set via the inspector or at runtime.

UseTouchPinchForZoom

Toggle this on to use a touch pinch gesture for zooming.

Declaration
public bool UseTouchPinchForZoom { get; set; }
Property Value
Type Description
bool

This value can be set via the inspector or at runtime.

Methods

MoveCameraBy(Vector3, float?)

Animate the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CameraOrigin by an offset in world coordinates. If no animationTime is provided, the default Goehler.IO.OrbitalCam.OrbitalCameraSystem.StepAnimationTime will be used.

Declaration
public void MoveCameraBy(Vector3 offset, float? animationTime = null)
Parameters
Type Name Description
Vector3 offset
float? animationTime

MoveCameraBy(Vector3)

Declaration
public void MoveCameraBy(Vector3 offset)
Parameters
Type Name Description
Vector3 offset

MoveCameraByLocal(Vector3, float?)

Animate the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CameraOrigin by an offset in local coordinates. If no animationTime is provided, the default Goehler.IO.OrbitalCam.OrbitalCameraSystem.StepAnimationTime will be used.

Declaration
public void MoveCameraByLocal(Vector3 offset, float? animationTime = null)
Parameters
Type Name Description
Vector3 offset
float? animationTime

MoveCameraByLocal(Vector3)

Declaration
public void MoveCameraByLocal(Vector3 offset)
Parameters
Type Name Description
Vector3 offset

MoveCameraTo(Vector3, float?)

Animate the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CameraOrigin from its current position to the destination in world coordinates. If no animationTime is provided, the default Goehler.IO.OrbitalCam.OrbitalCameraSystem.StepAnimationTime will be used.

Declaration
public void MoveCameraTo(Vector3 destination, float? animationTime = null)
Parameters
Type Name Description
Vector3 destination
float? animationTime

MoveCameraTo(Vector3)

Declaration
public void MoveCameraTo(Vector3 destination)
Parameters
Type Name Description
Vector3 destination

MoveCameraUpByLocal(float, float?)

Animate the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CameraOrigin upwards by a distance in local coordinates. Use a negative distance to move down. If no animationTime is provided, the default Goehler.IO.OrbitalCam.OrbitalCameraSystem.StepAnimationTime will be used.

Declaration
public void MoveCameraUpByLocal(float distance, float? animationTime = null)
Parameters
Type Name Description
float distance
float? animationTime

MoveCameraUpByLocal(float)

Declaration
public void MoveCameraUpByLocal(float distance)
Parameters
Type Name Description
float distance

RemoveLockOnTarget()

Remnove the transform target that the camera is following, and unlock the camera movement again.

Declaration
public void RemoveLockOnTarget()

RotateAndTiltCameraBy(Vector2, float?)

Animate the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CameraOrigins rotation and tilt by a Vector2 offset in euler angles. If no animationTime is provided, the default Goehler.IO.OrbitalCam.OrbitalCameraSystem.StepAnimationTime will be used.

Declaration
public void RotateAndTiltCameraBy(Vector2 inputVector, float? animationTime = null)
Parameters
Type Name Description
Vector2 inputVector
float? animationTime

RotateAndTiltCameraBy(Vector2)

Declaration
public void RotateAndTiltCameraBy(Vector2 inputVector)
Parameters
Type Name Description
Vector2 inputVector

RotateAndTiltCameraTo(Vector2, float?)

Animate the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CameraOrigins rotation and tilt to specific euler angles provided by a Vector2 representation. If no animationTime is provided, the default Goehler.IO.OrbitalCam.OrbitalCameraSystem.StepAnimationTime will be used.

Declaration
public void RotateAndTiltCameraTo(Vector2 inputVector, float? animationTime = null)
Parameters
Type Name Description
Vector2 inputVector
float? animationTime

RotateAndTiltCameraTo(Vector2)

Declaration
public void RotateAndTiltCameraTo(Vector2 inputVector)
Parameters
Type Name Description
Vector2 inputVector

RotateCameraBy(float, float?)

Animate the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CameraOrigins horizontal rotation by a float amount in euler angles. If no animationTime is provided, the default Goehler.IO.OrbitalCam.OrbitalCameraSystem.StepAnimationTime will be used.

Declaration
public void RotateCameraBy(float angle, float? animationTime = null)
Parameters
Type Name Description
float angle
float? animationTime

RotateCameraBy(float)

Declaration
public void RotateCameraBy(float angle)
Parameters
Type Name Description
float angle

RotateCameraTo(float, float?)

Animate the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CameraOrigins horizontal rotation to a specific euler angle in world coordinates. If no animationTime is provided, the default Goehler.IO.OrbitalCam.OrbitalCameraSystem.StepAnimationTime will be used.

Declaration
public void RotateCameraTo(float amount, float? animationTime = null)
Parameters
Type Name Description
float amount
float? animationTime

RotateCameraTo(float)

Declaration
public void RotateCameraTo(float amount)
Parameters
Type Name Description
float amount

SetLockOnTarget(Transform)

Set a transform target that the camera will follow, and lock the user camera movement (but not rotation and zoom)

Declaration
public void SetLockOnTarget(Transform target)
Parameters
Type Name Description
Transform target

SetPosition(Vector3)

Instantly set the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CameraOrigin to a world coordinate.

Declaration
public void SetPosition(Vector3 position)
Parameters
Type Name Description
Vector3 position

SetRotation(float)

Instantly set the local rotation of Goehler.IO.OrbitalCam.OrbitalCameraSystem.CameraOrigin to a quaterion.

Declaration
public void SetRotation(float degrees)
Parameters
Type Name Description
float degrees

SetTilt(float)

Instantly set the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CurrentTiltAngle to a specific euler angle.

Declaration
public void SetTilt(float angle)
Parameters
Type Name Description
float angle

SetZoom(float)

Instantly set the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CurrentZoomMagnitude to a specific distance from the target.

Declaration
public void SetZoom(float magnitude)
Parameters
Type Name Description
float magnitude

TiltCameraBy(float, float?)

Animate the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CameraOrigins vertical tilt by a float amount in euler angles. If no animationTime is provided, the default Goehler.IO.OrbitalCam.OrbitalCameraSystem.StepAnimationTime will be used.

Declaration
public void TiltCameraBy(float angle, float? animationTime = null)
Parameters
Type Name Description
float angle
float? animationTime

TiltCameraBy(float)

Declaration
public void TiltCameraBy(float angle)
Parameters
Type Name Description
float angle

TiltCameraTo(float, float?)

Animate the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CameraOrigins vertical tilt to a specific euler angle from the ground. If no animationTime is provided, the default Goehler.IO.OrbitalCam.OrbitalCameraSystem.StepAnimationTime will be used.

Declaration
public void TiltCameraTo(float amount, float? animationTime = null)
Parameters
Type Name Description
float amount
float? animationTime

TiltCameraTo(float)

Declaration
public void TiltCameraTo(float amount)
Parameters
Type Name Description
float amount

ZoomCameraBy(float, float?)

Animate the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CurrentZoomMagnitude by a specific distance from its current position. If no animationTime is provided, the default Goehler.IO.OrbitalCam.OrbitalCameraSystem.StepAnimationTime will be used.

Declaration
public void ZoomCameraBy(float distance, float? animationTime = null)
Parameters
Type Name Description
float distance
float? animationTime

ZoomCameraBy(float)

Declaration
public void ZoomCameraBy(float distance)
Parameters
Type Name Description
float distance

ZoomCameraTo(float, float?)

Animate the Goehler.IO.OrbitalCam.OrbitalCameraSystem.CurrentZoomMagnitude to a specific distance from the target. If no animationTime is provided, the default Goehler.IO.OrbitalCam.OrbitalCameraSystem.StepAnimationTime will be used.

Declaration
public void ZoomCameraTo(float distance, float? animationTime = null)
Parameters
Type Name Description
float distance
float? animationTime

ZoomCameraTo(float)

Declaration
public void ZoomCameraTo(float distance)
Parameters
Type Name Description
float distance
In this article
Back to top © 2023-2025 Goehler Studios