Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

why is this camera manipulation not working??

Asked by 5 years ago

local script:

local newcam = workspace.newCamera.Camera
local cam = workspace.CurrentCamera
repeat
cam.CameraType = Enum.CameraType.Scriptable
until
cam.CameraType == Enum.CameraType.Scriptable
cam.CFrame = newcam.CFrame

1 answer

Log in to vote
1
Answered by
DanzLua 2879 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

Without waiting for the CurrentCamera to load, we won't be able to set its CameraType

repeat wait() until workspace.CurrentCamera
wait()

local newcam = workspace.newCamera.Camera
local cam = workspace.CurrentCamera
repeat
cam.CameraType = Enum.CameraType.Scriptable
until
cam.CameraType == Enum.CameraType.Scriptable
cam.CFrame = newcam.CFrame

0
Oh.. Thenk You DanzLua! Freddan2006YT 88 — 5y
Ad

Answer this question