Studio freezing/crashing when playtesting a cutscene

Hey!* I dont know how or why but my studio keeps crashing when i test a cutscene for my game, the most rare thing is that in R6 studio crashes but on R15 it doesn’t, Could anyone know why or how this is happening?

R15 Playtest

External Media

R6 Playtest

External Media

My code for the cutscene

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")

local Player = Players.LocalPlayer
local Events = ReplicatedStorage:WaitForChild("Events")
local SuperChargeEvents = Events:WaitForChild("SuperCharge")

local Camera = game.Workspace.CurrentCamera
local CutsceneFrame = script.Parent.CutsceneFrame

local Sfx = script.Sfx
local CutsceneTrigger = SuperChargeEvents:WaitForChild("CutsceneTrigger")

function SFX()
	Sfx.Transformation.Volume = 1.6
	Sfx.Music.Volume = 0
	
	Sfx.Transformation:Play()
	wait(0.2)
	Sfx.Music:Play()
	wait(0.5)
	TweenService:Create(Sfx.Music, TweenInfo.new(0.8), { Volume = 0.8 }):Play()
end

function start(Character)
	if Character:FindFirstChild("Humanoid") then
		local Root = Character:WaitForChild("HumanoidRootPart")
		local Humanoid = Character:WaitForChild("Humanoid")
		
		TweenService:Create(CutsceneFrame.UIScale, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), { Scale = 1 }):Play()
		TweenService:Create(Humanoid, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), { CameraOffset = Vector3.new(0,0,0) }):Play()
		
		Root.Anchored = true
		Camera.CameraType = Enum.CameraType.Scriptable
	end
end

CutsceneTrigger.OnClientEvent:Connect(function(mainPlayer: Player)
	if mainPlayer.Name == Player.Name then
		-- When the player to get the power is the client
		SFX()
		start(mainPlayer.Character)
	else
		-- When someone else gets the power
		SFX()
	end
end)

when event is triggered the script shows a diferent cutscene for the player that got the power and for the other players that didnt.

Edit: Oh, and ignore the music, its going to be replaced soon, Sorry :frowning:

If you run the script without animation like the code you posted does the character still freeze?

By the looks of it, your code for the cutscene itself should not be causing the freezing. It may have something to do with how you are handling it on the other ends or just other scripts in general.

Yeah, i thinked that, but its the camera going to scriptable that makes it freeze, I think its maybe bc of the smooth shift lock, let me see and confirm to you.

Sorry for late response, It was the shiftlock that was causing the camera to break since 2 movements of camera were made at same time and causing studio to crash. Thanks for your help.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.