Lớp công cụ
Camera
*Nội dung này được dịch bằng AI (Beta) và có thể có lỗi. Để xem trang này bằng tiếng Anh, hãy nhấp vào đây.
Tóm Tắt
Thuộc Tính
ViewportSize:ScreenSafeInsetsModel |
Phương Pháp
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):() |
Sự Kiện
Thành viên kế thừa
4 thành viên kế thừa từ PVInstance
57 thành viên kế thừa từ Instance
6 thành viên kế thừa từ Object
Tài Liệu Tham Khảo API
Thuộc Tính
CameraSubject
Mẫu mã
Đối tượng Camera
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
endCoordinateFrame
focus
ViewportSize
Camera.ViewportSize:ScreenSafeInsetsModel
Phương Pháp
GetLargestCutoffDistance
GetPanSpeed
GetPartsObscuringTarget
GetRoll
GetTiltSpeed
Interpolate
PanUnits
ScreenPointToRay
SetCameraPanMode
SetRoll
TiltUnits
ViewportPointToRay
WorldToScreenPoint
WorldToViewportPoint
ZoomToExtents
Lợi Nhuận
()
Mẫu mã
Phóng To Kích Thước
local camera = workspace.CurrentCamera
local model = workspace:FindFirstChild("MyModel")
if model then
local modelCFrame = model:GetModelCFrame()
local extentsSize = model:GetExtentsSize()
camera:ZoomToExtents(modelCFrame, extentsSize)
endSự Kiện
InterpolationFinished