So right now I basically have this weird thing going on where I’m trying to update the camera’s position to match the cameraPart, but it doesn’t seem to be working. I’ve provided a video, along with the script that’s supposed to be moving the camera.
SCRIPT:
local checkCameraPositionCoro = coroutine.create(function()
local camera = game.Workspace.CurrentCamera
while true do
camera.CameraType=Enum.CameraType.Scriptable
camera.CFrame = game.Workspace.CameraPart.CFrame
print(camera.CameraType)
wait()
end
end)
coroutine.resume(checkCameraPositionCoro)
Hello! For the start, replace while-loop with RunService.RenderStepped, because it will enable significantly smoother movement, works at higher rates and runs with each rendered frame, as the name suggests. Furthermore, wait() is considered a bad choice, and is part of 30Hz Roblox pipeline, so it is not as reliable and consistent, hence delays sometimes being much higher than 0.03 s.
local RunService = game:GetService("RunService")
local camera = workspace.CurrentCamera
local checkCameraPositionCoro = coroutine.create(function()
RunService.RenderStepped:Connect(function()
camera.CameraType=Enum.CameraType.Scriptable
camera.CFrame = game.Workspace.CameraPart.CFrame
end)
end)
coroutine.resume(checkCameraPositionCoro)