CutsceneService - Smooth cutscenes using Bézier curves

Version 1.2.0 was just released, feel free to update the module.

1 Like

Amazing module, using it in numerous projects!

Thank you for the feedback! :slightly_smiling_face:

1 Like

How would I connect it to activate a cutscene when you touch a part?

Also where it would play for everybody

That is really simple. You can just connect a function to the BasePart.Touched event.

part.Touched:Connect(function()
	cutscene:Play()
end)

Don’t forget to add debounce, otherwise the event will fire multiple times.

local debounce = false

part.Touched:Connect(function()
	if not debounce then
		debounce = true
		
		cutscene:Play()
		cutscene.Completed:Wait() --:Play() doesn't yield
		
		debounce = false
	end
end)

If you want it to only play for yourself, you can add this:

local debounce = false
local character = game.Players.LocalPlayer.Character

part.Touched:Connect(function(otherPart)
	if not debounce and otherPart.Parent == character then
		debounce = true
		
		cutscene:Play()
		cutscene.Completed:Wait() --:Play() doesn't yield
		
		debounce = false
	end
end)

Hi there!
Great system, just found an overlook.
If you stop a cutscene while it’s running, with movement locked, it wont unlock movement.
It would be nice to have this fixed!
Thanks!

Code:

local CutsceneService = require(game.ReplicatedStorage.CutsceneService)
local func = CutsceneService.Functions
local cutscene1 = CutsceneService:Create(workspace.Cutscene1, 35, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut, func.StartFromCurrentCamera, func.EndWithDefaultCamera, func.DisableControls)

local db = false
wait(1)
cutscene1:Play()

local plt = game.Players.LocalPlayer

plt:SetAttribute("PlayCutscene", true)

local PlayC = plt:GetAttribute("PlayCutscene")

plt:GetAttributeChangedSignal("PlayCutscene"):Connect(function()
	if db == false then
		cutscene1:Cancel()
		warn("Cutscene cancelled.")
		db = true
	else
		cutscene1:Cancel()
		cutscene1:Play()
		print("Cutscene restarted.")
		db = false
	end
end)

It also seems like if a player resets/dies while a cutscene is playing, the camera is stuck where they died.

Oopsie, thank you very much for the report!
Unfortunately I can’t fix it in the next 5 days because I’m on vacation right now.
When I’m home, I’ll make sure to look into it! :+1:

2 Likes

Thanks! Our game update is soon, try to fix it by then!

Also, some feedback:
The Attributes I added should probably be there by default. It would be easier, so you could even tween the camera when the attribute is changed, or the cutscene is cancelled.

Is there any way I can set the attribute to false when the cutscene ends?

An attribute that plays a cutscene when set to true or cancels the current one when set to false?

That could be useful but if there are multiple cutscenes, how should it know which one to play? It would be possible to implement a function that creates an attribute which is linked to a specific cutscene. When that attribute is activated, it will know the cutscene it should play.

You can do that with the cutscene.Completed event.

1 Like

Thanks for the suggestion!
Yeah, I never thought of that, because I’m only using it for 1/

  1. How can I change the speed of the cutscene? It just goes really fast and I didn’t see anything about it on the tutorial.

  2. I haven’t seen one yet, but a youtube tutorial would be really nice

  3. Great plugin! I really enjoy it

1 Like

You can change the duration which is the second argument. Example:

local cutscene = CutsceneService:Create(folder, duration)

I already wanted to make one, but I haven’t had time to do that yet. I’ll try to do it before my exams. :slightly_smiling_face:

Thanks, I love getting feedback from users! Make sure to ask me if you have further questions.

1 Like

This is really amazing! Keep up the great work

Would you mind adding a loop option? would make my life easier because I’m getting camera issues after doing Pause() > Resume() then:

LobbyCutscene.Completed:Connect(function(State)
    if State == Enum.PlaybackState.Completed then
        LobbyCutscene:Play()
   end
end)

Yeah that’s a good idea. You are getting problems because I’m firing the Completed event before changing the CameraType back. I’ll fix that today or tomorrow!

1 Like

I updated the module with some bug fixes. New features are to come in the next days!

Can you please release queues? The module is great and I want to repeat cutscenes after each other successively but can’t do so right now. If you could work on the feature and get it out, that would be appreciated.

Sorry that I haven’t released it yet. I am very busy and also focused on another module until now. I’ll try to finish version 1.3.0 soon.