Camera
The Local Player's camera system. Must be called from LocalScript.
Properties
| Name | Type | Description |
|---|---|---|
| FOV | Number | Field of view in degrees |
| Position | Vector3 | Camera position in world space |
| Forward | Vector3 | Camera forward direction |
| Up | Vector3 | Camera up direction |
| Right | Vector3 | Camera right direction |
| Rotation | Vector3 | Camera rotation in euler angles |
| LockInput | Boolean | Lock camera input. Set to true to control camera from script |
| Target | Dynamic | Current target object being followed |
| RelativePosition | Vector3 | Camera position relative to target |
| RelativeRotation | Vector3 | Camera rotation relative to target |
| NearClipPlane | Number | Near clip plane distance |
| FarClipPlane | Number | Far clip plane distance |
| IsFirstPerson | Boolean | Is camera currently in first person mode |
Functions
| Name | Returns | Description |
|---|---|---|
| ResetTarget | Void | Reset camera target to player |
| LookAt | Void | Smoothly look at a position |
| WorldToScreenPoint | Vector3 | Convert world point to screen point |
| ScreenToWorldPoint | Vector3 | Convert screen point to world point |
| ScreenPointToRay | Ray | Create a ray from camera through screen point |
| SetViewportMode | Void | Set viewport mode to first/third person |
Events
| Name | Description |
|---|---|
| CameraChanged | Fired when camera properties are changed |
| ViewportChanged | Fired when camera mode changes (first/third person) |