Implementing cutscene skipping

I have this super duper long linear cutscene script, however, due to my game being quite long, it’s quite expected to have players wanting to skip certain common intermediary cutscenes. The thing is, nothing comes to mind that can make cutscenes skippable. I’ve thought of many things, most of which have to do with coroutines, replacing certain yielding functions, and so forth, but again, nothing has proven logically sufficient.

The most promising thing is to use coroutines and have them be garbage collected, but coroutines can only be garbage collected if:


A.) All references are severed.
B.) The coroutine is dead. Not yielded or running.


The largest issue is issue B. You can’t kill coroutines from the outside, because, well, that kinda… removes the point of coroutines, no? Anywho.

I’m trying to come up with an elegant solution, so I’d appreciate it greatly if getfenv and pcall aren’t factors… hopefully that request doesn’t require me making a feature request in the end. Oh dear.


Source is here:
https://pastie.io/dcrdhv.lua

Please don’t mind the code smell. I’ve been coding in debt and now all my fundamentals are in _G. :{

4 Likes

I don’t really know if you can do something with this but this script is what i use to make cut scenes

local TweenService = game:GetService("TweenService")

local Camera = game.Workspace.Camera

local CutsceneTimeSlow = 1

local tweenInfo1 = TweenInfo.new(
	CutsceneTimeSlow,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)

function tween1 (Part1,Part2)
	Camera.CameraType = Enum.CameraType.Scriptable
	Camera.CFrame = Part1.CFrame

	local tween = TweenService:Create(Camera, tweenInfo1, {CFrame = Part2.CFrame})
	tween:Play()

	wait(CutsceneTimeSlow)
	Camera.CameraType = Enum.CameraType.Custom
end


wait(0)
tween1(game.Workspace.Scene.ScenePart1, game.Workspace.Scene.ScenePart2)
1 Like

but maybe you can insert a Button in a Screen GUI and then add in in the script so if you press it it will stop it from playing

1 Like

Not quite what I’m looking for, but I greatly appreciate the attempt nevertheless. Thanks! :0


Edited the main post with the source.

1 Like

Ok that’s fine i’m also a begginer scripter i can like only do the basics and a little bit other stuff i’m still learning but i also don’t know how it’s pretty hard to find something good to learn it.

Also maybe you know the problem of my script: My problem

1 Like