title, I’m trynna make a cutscene where I tween the camera to 3 parts, but it isn’t working:
local tS = game:GetService("TweenService") -- This is required or the next options like "TweenInfo.new" won't be available.
local camera = game:GetService("Workspace"):WaitForChild("Camera") -- Adding a variable for the camera.
local cutsceneTime = 12 -- Time of the cutscene.
local tI = TweenInfo.new(
cutsceneTime,
Enum.EasingStyle.Quint, -- How fast the camera will move.
Enum.EasingDirection.InOut, -- The direction the camera will take.
0, -- Depeat count
false, -- If the cutscene reverses
0 -- Delay time
)
local function tween(camera1, camera2, camera3) -- Adding a local function to make things more simpler, and adding a few parameters for extra simplicity.
camera.CameraType = Enum.CameraType.Scriptable -- Making sure we can script the camera.
camera.CFrame = camera1.CFrame -- Making sure the CFrame ( CFrame is basically the camera's position ) of the camera matches up with the part.
local tween = tS:Create(camera, tI, {CFrame = camera2.CFrame}, {CFrame = camera3.CFrame}) -- Making a variable for the tweening.
tween:Play() -- Playing the tween.
wait(cutsceneTime) -- Duration of the tween
end
wait(1) -- Adding a "wait" to make sure everything loads in.
tween(game:GetService("Workspace"):WaitForChild("CameraAngles"):WaitForChild("Island1"):WaitForChild("a"), game:GetService("Workspace"):WaitForChild("CameraAngles"):WaitForChild("Island1"):WaitForChild("b")) -- Finally tweening the parts.
tween(game:GetService("Workspace"):WaitForChild("CameraAngles"):WaitForChild("Island1"):WaitForChild("b"), game:GetService("Workspace"):WaitForChild("CameraAngles"):WaitForChild("Island1"):WaitForChild("c")) -- Since I can only tween two parts at a time, I have to write another line.
I wrote on the last line of the script, where you can see im tweening b, and c.
also there is a error in output, Tried to index nil with cframe, which i beilive its refering to the {CFrame = camera3.CFrame}
If you mean the third tween finishes and then the camera stays in one place, that’s because you have to set the camera back on the player manually. That’s the only way to do it, cutscenes just work like that.
The quality of your ChatGPT answers is directly proportional to the quality of the prompts you use; in other words, if the questions you ask are bad or lazy, the answers won’t be accurate, whereas if the questions you ask are concise and relevant to solving your problem, ChatGPT will almost always come up with an elegant solution.
It is true that ChatGPT’s knowledge of roblox scripting is limited to information during and before the year 2021, but resetting your camera after a cutscene has been around since the beginning of manual camera manipulation on roblox, which is many years old.
So, anything you’re implying about ChatGPT not being accurate is simply not true, unless you ask the wrong questions. Here’s a hint: The more information you give it/the more you include in your questions, the better answers it gives.