Camera
概要
屬性
方法
GetLargestCutoffDistance(ignoreList: Instances):number |
GetPartsObscuringTarget(castPoints: {any},ignoreList: Instances):Instances |
Interpolate(endPos: CFrame,endFocus: CFrame,duration: number):() |
ScreenPointToRay(x: number,y: number,depth: number):Ray |
SetCameraPanMode(mode: Enum.CameraPanMode):() |
ViewportPointToRay(x: number,y: number,depth: number):Ray |
WorldToScreenPoint(worldPoint: Vector3):Tuple |
WorldToViewportPoint(worldPoint: Vector3):Tuple |
ZoomToExtents(boundingBoxCFrame: CFrame,boundingBoxSize: Vector3):() |
API 參考
屬性
Camera Subject
範例程式碼
相機主體
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local camera = workspace.CurrentCamera
local function resetCameraSubject()
if camera and localPlayer.Character then
local humanoid = localPlayer.Character:FindFirstChildWhichIsA("Humanoid")
if humanoid then
camera.CameraSubject = humanoid
end
end
end
resetCameraSubject()Coordinate Frame
focus
方法
Get Largest Cutoff Distance
Get Pan Speed
Get Parts Obscuring Target
Get Roll
Get Tilt Speed
Interpolate
Pan Units
Screen Point To Ray
Set Camera Pan Mode
Set Roll
Tilt Units
Viewport Point To Ray
World To Viewport Point
Zoom To Extents
返回
()
範例程式碼
縮放到範圍
local camera = workspace.CurrentCamera
local model = workspace:FindFirstChild("MyModel")
if model then
local modelCFrame = model:GetModelCFrame()
local extentsSize = model:GetExtentsSize()
camera:ZoomToExtents(modelCFrame, extentsSize)
end活動
Interpolation Finished