Camera

The Local Player's camera system. Must be called from LocalScript.

Properties

Name Type Description
FOVNumberField of view in degrees
PositionVector3Camera position in world space
ForwardVector3Camera forward direction
UpVector3Camera up direction
RightVector3Camera right direction
RotationVector3Camera rotation in euler angles
LockInputBooleanLock camera input. Set to true to control camera from script
TargetDynamicCurrent target object being followed
RelativePositionVector3Camera position relative to target
RelativeRotationVector3Camera rotation relative to target
NearClipPlaneNumberNear clip plane distance
FarClipPlaneNumberFar clip plane distance
IsFirstPersonBooleanIs camera currently in first person mode

Functions

Name Returns Description
ResetTargetVoidReset camera target to player
LookAtVoidSmoothly look at a position
WorldToScreenPointVector3Convert world point to screen point
ScreenToWorldPointVector3Convert screen point to world point
ScreenPointToRayRayCreate a ray from camera through screen point
SetViewportModeVoidSet viewport mode to first/third person

Events

Name Description
CameraChangedFired when camera properties are changed
ViewportChangedFired when camera mode changes (first/third person)