Cameraクラス

クラス日本語解説あり

ひとことで言うと

プレイヤーが見ている視点(カメラ)を表すクラスです。LocalScriptから workspace.CurrentCamera で使います。

公式の説明(英語):A class which defines a view of the 3D world.

クラスの関係

受け継いでいるクラス:Object → Instance → PVInstance → Camera

このクラスを受け継ぐクラス:ViewportCamera

プロパティ(17)

名前と書き方説明
CameraSubject
Camera.CameraSubject: Instance
The Humanoid or BasePart that is the Camera subject.
CameraType
Camera.CameraType: CameraType
カメラの動き方の種類。Scriptableにすると、スクリプトで自由に動かせます。Specifies the CameraType to be read by the camera scripts.
CFrame
Camera.CFrame: CFrame
カメラの位置と向き。The CFrame of the Camera, defining its position and orientation in the 3D world.
DiagonalFieldOfView
Camera.DiagonalFieldOfView: float
Sets the angle of the camera's diagonal field of view.
FieldOfView
Camera.FieldOfView: float
視野の広さ(度)。Sets the angle of the camera's vertical field of view.
FieldOfViewMode
Camera.FieldOfViewMode: FieldOfViewMode
Determines the FOV value of the Camera that's invariant under viewport size changes.
Focus
Camera.Focus: CFrame
Sets the area in 3D space that is prioritized by Roblox's graphical systems.
HeadLocked
Camera.HeadLocked: boolean
Toggles whether the camera will automatically track the head motion of a player using a VR device.
HeadScale
Camera.HeadScale: float
Sets the scale of the user's perspective of the world when using VR.
MaxAxisFieldOfView
Camera.MaxAxisFieldOfView: float
Sets the angle of the camera's field of view along the longest viewport axis.
NearPlaneZ
Camera.NearPlaneZ: float
Describes the negative **Z** offset, in studs, of the camera's near clipping plane.
OrthographicMode
Camera.OrthographicMode: OrthographicMode
Sets which screen axis Class.Camera.OrthographicSize|OrthographicSize is applied to.
OrthographicSize
Camera.OrthographicSize: float
Sets the extent in studs of the dimension chosen by Class.Camera.OrthographicMode|OrthographicMode.
ProjectionType
Camera.ProjectionType: ProjectionType
Chooses between perspective and orthographic cameras.
ViewportSize
Camera.ViewportSize: Vector2
The dimensions of the device safe area on a Roblox client.
ViewStretch
Camera.ViewStretch: float
Stretches the axis of the view not pinned by the current Class.Camera.FieldOfViewMode|FieldOfViewMode or Class.Camera.OrthographicMode|OrthographicMode.
VRTiltAndRollEnabled
Camera.VRTiltAndRollEnabled: boolean
Toggles whether to apply tilt and roll from the Class.Camera.CFrame|CFrame property while the player is using a VR device.

メソッド(7)

名前と書き方説明
GetPartsObscuringTarget
Camera:GetPartsObscuringTarget(castPoints: Array, ignoreList: Instances): Instances
Returns an array of Class.BasePart|BaseParts that are obscuring the lines of sight between the camera's Class.Camera.CFrame|CFrame and the cast points.
GetRenderCFrame
Camera:GetRenderCFrame(): CFrame
Returns the actual CFramewhere the Camera is being rendered, accounting for any roll applied and the impact of VR devices.
ScreenPointToRay
Camera:ScreenPointToRay(x: float, y: float, depth: float): Ray
Creates a unit Ray from a position on the screen (in pixels), at a set depth from the Camera orientated in the camera's direction. Accounts for the GUI inset.
ViewportPointToRay
Camera:ViewportPointToRay(x: float, y: float, depth: float): Ray
Creates a unit Ray from a position on the viewport (in pixels), at a given depth from the Camera, orientated in the camera's direction. Does not account for the Enum.ScreenInsets|CoreUISafeInsets inset.
WorldToScreenPoint
Camera:WorldToScreenPoint(worldPoint: Vector3): Tuple
Returns the screen location and depth of a Vector3 worldPoint and whether this point is within the bounds of the screen. Accounts for the GUI inset.
WorldToViewportPoint
Camera:WorldToViewportPoint(worldPoint: Vector3): Tuple
Returns the screen location and depth of a Vector3 worldPoint and whether this point is within the bounds of the screen. Does not account for the GUI inset.
ZoomToExtents
Camera:ZoomToExtents(boundingBoxCFrame: CFrame, boundingBoxSize: Vector3): ()
Adjusts the Class.Camera.CFrame|CFrame so that the specified bounding box is fully visible within the camera's viewport.

受け継いでいるメンバー

PVInstance から受け継いでいるもの(4)

Origin・Pivot Offset・GetPivot・PivotTo

Instance から受け継いでいるもの(46)

Archivable・Capabilities・IsInSandbox・Name・Parent・PredictionMode・Sandboxed・AddTag・ClearAllChildren・Clone・Destroy・FindFirstAncestor・FindFirstAncestorOfClass・FindFirstAncestorWhichIsA・FindFirstChild・FindFirstChildOfClass・FindFirstChildWhichIsA・FindFirstDescendant・GetActor・GetAttribute・GetAttributeChangedSignal・GetAttributes・GetChildren・GetDebugId・GetDescendants・GetFullName・GetStyled・GetStyledPropertyChangedSignal・GetTags・HasTag・IsAncestorOf・IsDescendantOf・IsPropertyModified・QueryDescendants・RemoveTag・ResetPropertyToDefault・SetAttribute・WaitForChild・AncestryChanged・AttributeChanged・ChildAdded・ChildRemoved・DescendantAdded・DescendantRemoving・Destroying・StyledPropertiesChanged

Object から受け継いでいるもの(4)

ClassName・GetPropertyChangedSignal・IsA・Changed

英語の説明とメンバーの一覧は、Roblox Creator Documentation(Camera)をもとにしています(CC BY 4.0)。日本語の解説は、このサイトで独自に書いたものです。

執筆:鈴木孝昌官公庁のWeb・システム開発を担当する現役プロジェクトマネージャー。沖縄マイクラ部 クロスウェーブで、ロブロックス(Roblox)・マインクラフト(マイクラ)・Scratchなどのプログラミングを指導。マイクラカップ沖縄代表チームを指導(第6回・第7回、第7回TBS賞)。
沖縄マイクラ部で、子どもたちにロブロックス(Roblox)やマインクラフト(マイクラ)のプログラミングを教えています。プロフィールと編集方針
Instagramで教室の様子を見る
noteで記事を読む