Class:Camera

The Camera class represents a view of the game world. The Camera class inherits from.

Camera objects are not replicated to the server and exist only on the client of each player. Because they are stored locally, they cannot be accessed by s; must be used instead to get the player's camera. The player's local camera can be given by the property of.

Game developers can create parts that can only be seen by one player via the camera by putting parts within the camera. Only the player will collide with such parts, and such parts cannot be removed using a Script.

Scripts and LocalScripts placed into the camera do not run. Such things can only happen to parts in cameras if they are controlled by a LocalScript elsewhere.

<!-- == Properties ==

The current position and rotation of the Camera. For most CameraTypes, the rotation is set such that the CoordinateFrame lookVector is pointing at the Focus.

Where the Camera's focus is. Any rotation of the camera will be about this subject.

Defines how the camera will behave.

The current position and rotation of the Camera. For most CameraTypes, the rotation is set such that the CoordinateFrame lookVector is pointing at the Focus.

The current angle, or width, of what the camera can see. Current acceptable values are from 20 degrees to 80.

The current CoordinateFrame that the camera is looking at. Note: it is not guaranteed that the camera is always looking here.

Holds the x,y screen resolution of the viewport the camera is presenting (note: this can differ from the AbsoluteSize property of a full screen gui).

Returns the camera's current roll. Roll is defined in radians, and is stored as the delta from the camera's y axis default normal vector.

Takes a 2D screen position and produces a Ray object to be used for 3D raycasting. Input is x,y screen coordinates, and a (optional, defaults to 0) z position which sets how far in the camera look vector to start the ray origin.

Sets the camera's current roll. Roll is defined in radians, and is stored as the delta from the camera's y axis default normal vector.

Same as ScreenPointToRay, except no GUI offsets are taken into account. Useful for things like casting a ray from the middle of the Camera.ViewportSize

Takes a 3D position in the world and projects it onto x,y coordinates of screen space. Returns two values, first is a Vector3 that has x,y position and z position which is distance from camera (negative if behind camera, positive if in front). Second return value is a boolean indicating if the first argument is an on-screen coordinate.

Same as WorldToScreenPoint, except no GUI offsets are taken into account.

-->