that game looks amazing. Where can I play it?
It’s a game i’m still working hard on, so it’s not released yet
You are probably using animation events to code in the effects manually right? Or whats ur method to time the effects on frame?
How would I break the function? Cause I have to delete my character after I run it and rarely the character gets deleted before the cutscene ended and it freezes the screen
It returns HumanoidRootPart is not a part of BossChar???
My script
IntroCutsceneEvt.OnClientEvent:Connect(function(CFrameFolder, BossChar, DialogueFolder)
game.StarterGui:SetCoreGuiEnabled("Health", false)
wait()
StarterGUIService:SetCore("ResetButtonCallback", false)
local CinematicsFolder = CFrameFolder
local CurrentCameraCFrame = workspace.CurrentCamera.CFrame
local FrameTime = 0
local Connection
Character.Humanoid.AutoRotate = false
camera.CameraType = Enum.CameraType.Scriptable
Connection = RunService.RenderStepped:Connect(function(DT)
FrameTime += (DT * 60)
-- This will convert the seconds passed (DT) to the frame of the camera we need.
-- Then it adds it to the total amount of time passed since the animation started
local NeededFrame = CinematicsFolder.Frames:FindFirstChild(tonumber(math.ceil(FrameTime)))
if NeededFrame and BossChar then
if BossChar:WaitForChild("HumanoidRootPart") then
camera.CFrame = BossChar.HumanoidRootPart.CFrame * NeededFrame.Value
end
else
Connection:Disconnect()
Character.Humanoid.AutoRotate = true
camera.CameraType = Enum.CameraType.Custom
camera.CFrame = CurrentCameraCFrame
end
end)
wait(5.5)
game.StarterGui:SetCoreGuiEnabled("Health", true)
StarterGUIService:SetCore("ResetButtonCallback", true)
end)
check if bosschar.parent instead of bosschar
You could sent the Client the Character through the event. Then make it so that the function can intake Arguments for what character were focusing on
anybody know if I could use the cinematic function he provided for a looped camera cutscene (Ex: a loading screen or custom shop)
edit: for anybody wondering, it just took a bit of critical thinking.
this is how it works: if you don’t want to loop the cutscene, put false for the boolean parameter and it acts as normal. if so, the function will return another function that will end the loop.
here’s a modified version of his code that SHOULD still work for any instance, feel free to let me know of any errors or problems with my code
print("Hello world!")
local RunService = game:GetService("RunService")
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Camera = workspace.Camera
local function Cinematic(shouldLoop)
local CinematicsFolder = game.ReplicatedStorage:WaitForChild("camera1")
local FramesFolder = CinematicsFolder:WaitForChild("Frames")
local CurrentCameraCFrame = workspace.CurrentCamera.CFrame
local FrameTime = 0
local Connection
local IsLooping = shouldLoop or false
local BreakLoop = false
Character.Humanoid.AutoRotate = false
Camera.CameraType = Enum.CameraType.Scriptable
local function StopCinematic()
if Connection then
Connection:Disconnect()
Connection = nil -- to prevent potential double disconnects
end
Character.Humanoid.AutoRotate = true
Camera.CameraType = Enum.CameraType.Custom
Camera.CFrame = CurrentCameraCFrame
end
Connection = RunService.RenderStepped:Connect(function(DT)
if BreakLoop then
StopCinematic()
return
end
FrameTime += (DT * 60)
local NeededFrame = FramesFolder:FindFirstChild(tostring(math.ceil(FrameTime))) -- Changed tonumber to tostring
if NeededFrame then
Camera.CFrame = NeededFrame.Value
else
if IsLooping then
FrameTime = 0
else
StopCinematic()
end
end
end)
local function Break()
BreakLoop = true
end
-- return the baby function
return Break
end
--example usage
game.ReplicatedStorage:WaitForChild("cutscene").Event:Connect(function()
local breakloop = Cinematic(true)
wait(10)
breakloop()
end)