Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Part1 is in workspace but Part1 is not a valid member of Workspace in the dev console?

Script: game.ReplicatedStorage:WaitForChild("Cutscene1").OnClientEvent:Connect(function() if script.Done.Value == false then script.Done.Value = true

        local camera = game.Workspace.CurrentCamera
 
        camera.CameraType = "Scriptable"
        camera:Interpolate(game.Workspace.Part1.CFrame, game.Workspace.Part2.CFrame, 2)
        wait(2)
        camera:Interpolate(game.Workspace.Part2.CFrame, game.Workspace.Part3.CFrame, 2)
        wait(2)
        camera:Interpolate(game.Workspace.Part3.CFrame, game.Workspace.Part4.CFrame, 2)
        wait(2)
        camera:Interpolate(game.Workspace.Part4.CFrame, game.Workspace.Part5.CFrame, 2)
        wait(2)
        camera:Interpolate(game.Workspace.Part5.CFrame, game.Workspace.Part6.CFrame, 2)
        wait(2) camera.CameraType = "Custom"
 
 
    end
end)

Cant find Part1 in workspace when it is there

4 comments

0

put local Part1 = game.Workspace:WaitForChild("Part1")

0

How did you add Part1 in Workspace? Have you created them with a LocalScript?

0

Yes @masterjosuel1998

0

camera:Interpolate() is deprecated. Use tween instead

1 answer

You need to wait for the part to load in. The scripts run instantly therefore use :WaitForChild()

local part 1  = game.Workspace:WaitForChild("Part1")

You could do it without making a variable.

        local camera = game.Workspace.CurrentCamera

        camera.CameraType = "Scriptable"
        camera:Interpolate(game.Workspace:WaitForChild("Part1").CFrame, game.Workspace:WaitForChild("Part2").CFrame, 2)
        wait(2)
        camera:Interpolate(game.Workspace:WaitForChild("Part2").CFrame, game.Workspace:WaitForChild("Part3").CFrame, 2)
        wait(2)
        camera:Interpolate(game.Workspace:WaitForChild("Part3").CFrame, game.Workspace:WaitForChild("Part4").CFrame, 2)
        wait(2)
        camera:Interpolate(game.Workspace:WaitForChild("Part4").CFrame, game.Workspace:WaitForChild("Part5").CFrame, 2)
        wait(2)
        camera:Interpolate(game.Workspace:WaitForChild("Part5").CFrame, game.Workspace:WaitForChild("Part6").CFrame, 2)
        wait(2) camera.CameraType = "Custom"


    end
end)

3 comments

0

I just want to say, adding the ("Part1") kinda breaks it

0

this comes up now 15:18:10.711 - Players.fshduia.PlayerGui.LocalScript:16: Expected , got 'end'

0

I don't know where line 711 is

This discussion is preserved as it was. New answers, comments, and votes are closed.