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

How would I script a cutscene? *Not a request*

Could anyone link me a guide telling me how to script a cutscene, im not too good at understanding wiki, or camera manipulation, but if someone could link a blog post or something similar I would greatly appreciate it, and I think that would make me memorize camera manipulation, thanks.

1 comment

0

"Not a requests" - "Requests a Link". Alrighty. You could try breaking down how this plugin works (i.e the script that it adds): https://www.roblox.com/library/142296237/Cutscene-Editor-Plugin-FIXED

1 answer

For a cutscene, you would best try using :Interpolate() it's an option in Camera. But for Interpolate to work you would need to set the camera type to Scriptable, it can be done manually, but it can also be done using scripts.

Camera interpolating can only be done in LocalScripts

This is how to set CameraType for if you don't know how

camera.CameraType = "Scriptable"

So now that the camera is able to interpolate, we should try how!

local Cam_Endpoint = CFrame.new(10, 10, 10) -- Just a example location
local Cutscene_Time = 5 -- Just a example time
local Focus = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame -- The CFrame the camera will focus at! This is required

local cam = workspace.CurrentCamera -- Defining the camera
cam.CameraType = "Scriptable" -- Setting camera type, to make sure it works for if you forgot to do it manually

cam:Interpolate(Cam_Endpoint, Focus, Cutscene_Time)

Basically what the script above does is, it sets the camera type to Scriptable then it calls the :Interpolate() function in the camera, we also added 3 parameters, the end position of the camera Must be CFrame, what it will focus on while interpolating, and how long the cutscene will take place. So now we have the cutscene, but we have to reset the cam right? You could interpolate the camera back using

local Cam_Endpoint = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame --  Defining the HumanoidRootPart of the player
local Cutscene_Time = 5
local Focus = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame

local cam = workspace.CurrentCamera -- Defining the camera
cam.CameraType = "Scriptable"

cam:Interpolate(Cam_Endpoint, Focus, Cutscene_Time)

But why the HumanoidRootPart you may ask? Well, we use the HumanoidRootPart cause the HumanoidRootPart Isn't affected by the current animation playing. If you don't want to interpolate the camera back to the player, but want it to be back instantly, then use this instead

local cam = workspace.CurrentCamera -- Defining the camera
cam.CameraType = "Custom" -- You may change this to which camera type you want

If you are skipping for the final code, there are 2 below here, based on how you want it to return

Interpolating back

local Cam_Endpoint = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame --  Defining the HumanoidRootPart of the player
local Cutscene_Time = 5
local Focus = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame

local cam = workspace.CurrentCamera -- Defining the camera
cam.CameraType = "Scriptable"

cam:Interpolate(Cam_Endpoint, Focus, Cutscene_Time)

-- Interpolating back
cam:Interpolate(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame,game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame , Cutscene_Time)

Instantly back

local Cam_Endpoint = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame --  Defining the HumanoidRootPart of the player
local Cutscene_Time = 5
local Focus = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame

local cam = workspace.CurrentCamera -- Defining the camera
cam.CameraType = "Scriptable"

cam:Interpolate(Cam_Endpoint, Focus, Cutscene_Time)

-- Instantly going back
cam.CameraType = "Custom"

Wiki page about camera interpolation

I am sorry for any grammer error or misspelling any word!

I hope i helped you!

~jordikeijzers

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