In the game “Outlaster,” “Eviction Notice,” and “Total Roblox Drama,” there are cutscenes whenever you are to start a new obby, challenge, etc. I want to know the best way to handle Per-Challenge cutscenes and how to fire them. My current idea is, inside the folder that houses the competition/challenge, have a cameras folder with all of the cameras at the desired position, then fire a RemoteEvent to tell the player to commence (x) cutscene. On the client, whenever the remote is fired, it will go into a module script which looks roughly like the one below, and fire (x)'s function, which I code how long to tween it, which camerapart to tween to, different tween styles, etc., as you would if you were just putting it in Its own script. Is this a good way/the best way to handle it, or are there alternatives I should be looking into?
local cutscenes = {
['Scene1'] = function()
-- Manually create the scene in here
end
}
return cutscenes
Then to fire it;
local cutsceneModule = require(game:GetService("ReplicatedStorage").Modules.CutsceneModule)
RemoteEvent.OnServerEvent:Connect(function(Scene)
cutsceneModule[Scene]() -- fire the corresponding function
end)
TweenService is probably the best way to go about this, though lerping may work though I’ve never tried it, you’d just lerp a part and set the players camera to the part that lerps cframe
Yeah, I’m asking about the best way to go about storing entire cutscenes and playing them on request. This is the only way I know that would keep them organized and do what I want, but I’m open to anything as I want to make sure I’m handling it all correctly before I build upon it.
Normally, my structure for cutscenes is like this:
Main “Cutscene Controller” type script that handles what cutscene to play and has utility functions for each cutscene (like bezier curves)
For each cutscene I have, I have a child to the Cutscene Controller that is a module script for that cutscene.
In the Cutscene Controller, I just have a base function that plays a cutscene, like:
function CutsceneController:PlayCutscene(cutsceneName: string, props: {any}): ()
local cutscene = script:FindFirstChild(cutsceneName)
local module = cutscene and require(cutscene)
if not module then
return
end
cutscene:Play(props)
end
This is just a really basic setup, but I think it’s a good way to handle organizing cutscenes – especially because cutscenes typically have a TON of code that is just storing CFrame data.