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

Intro with camera interpolation; camera is buggy and not working?

Asked by 8 years ago

I'm working on an intro with camera interpolations. Everything should work fine considering I've already set the subject of the camera at the start and it should interpolate. Every few seconds the camera will move slightly and then it will return to the player as intended.

I will post the script here and comment the lines of interest.

local player = game.Players.LocalPlayer
local cp = game:GetService("ContentProvider")
local ui = script.Parent
local loading = ui:WaitForChild("loading")
local intro = ui:WaitForChild("intro")
local loadinfo = loading:WaitForChild("info")
local camera = workspace.CurrentCamera
loading.Visible = true
camera.CameraType = Enum.CameraType.Scriptable --setting the camera type to scriptable
camera.CameraSubject = workspace["1-pos"] --setting the camera subject



local assets = {175241531,
                        155724031,
                        143509154,
                        335695249,
                        202037629,
                        168126548}

function preload(assets) --just preloading some assets, everything works fine here
    for _, asset in pairs(assets) do
        wait(.1)
        print("loading "..asset)
        cp:Preload("rbxassetid://"..asset)
        loadinfo.Text = "loading sounds and images ["..cp.RequestQueueSize.."]; this will only take a moment"
    end
end

preload(assets)

loadinfo.Text = "ready!"

wait(2)

for i = 1,0,-.08 do
    wait()
    loading.over.BackgroundTransparency = i
end

loading.over.Transparency = 0
loadinfo.Visible = false
loading.TextLabel.Visible = false
loading.over.Visible = false

for i = 0,1,.08 do
    wait()
    loading.BackgroundTransparency = i
end

loading.Visible = false

wait(2)
camera:Interpolate(workspace["2-pos"].CFrame,workspace["2-focus"].CFrame,3) --interpolating
wait(3)
camera:Interpolate(workspace["3-pos"].CFrame,workspace["3-focus"].CFrame,2) --interpolating
wait(2)
camera:Interpolate(workspace["4-pos"].CFrame,workspace["4-focus"].CFrame,2) --interpolating
wait(2)
camera.CameraSubject = player.Character.Humanoid --returns camera to the character's humanoid
camera.CameraType = Enum.CameraType.Custom
print("hi")
0
instead of that just set the cframe instead of changing cam subject Hero_ic 502 — 8y
0
ty dirty_catheter 7 — 8y

Answer this question