so i have this issue with animations event on making a cutscene.
i try to search this delay on the events on animations, but i couldn’t find ANY or nothing similar with my problem. i been using a script from other post as a inspiration and using it for making a general cutscene
here the post:
here my script that i made:
local player = game.Players.LocalPlayer
local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local npc1 = workspace.CutSceneArea["House Coming"].h
local door = workspace.CutSceneArea["House Coming"].Door
local RunService = game["Run Service"]
local Camera = workspace.Camera
local npc1_Humanoid = npc1:WaitForChild("Humanoid")
local door_Humanoid = door:WaitForChild("Humanoid")
local animtable = {
animationD = door_Humanoid:LoadAnimation(game.ReplicatedFirst.Animations.HouseComing.Door);
animation = npc1_Humanoid:LoadAnimation(game.ReplicatedFirst.Animations.HouseComing.Karl);
}
animtable.animationD:Play()
animtable.animation:Play()
player.PlayerGui.Text.Enabled = false
player.PlayerGui.Text.Background.Mind.Visible = false
workspace.CutSceneArea["House Coming"].Model.Hat.Transparency = 1
workspace.CutSceneArea["House Coming"].Model.Hat.Highlight.Enabled = false
workspace.CutSceneArea["House Coming"].Maletin.Transparency = 1
workspace.CutSceneArea["House Coming"].Maletin.Highlight.Enabled = false
local effect = game.Lighting.Color
effect.TintColor = Color3.new(0,0,0)
local function Cinematic ()
local CinematicsFolder = script:WaitForChild("coming home")
local CurrentCameraCFrame = workspace.CurrentCamera.CFrame
local currentfov = workspace.CurrentCamera.FieldOfView
Camera.CameraType = Enum.CameraType.Scriptable
local FrameTime = 0
local fov = 0
local Connection
local Connection2
task.spawn(function()
animtable.animation:GetMarkerReachedSignal("none"):Connect(function()
npc1["Meshes/FedoraAccessory"].Handle.Highlight.Enabled = true
npc1["Meshes/FedoraAccessory"].Handle.Transparency = 0
npc1.Maletin.Highlight.Enabled = true
npc1.Maletin.Transparency = 0
workspace.CutSceneArea["House Coming"].Model.Hat.Transparency = 1
workspace.CutSceneArea["House Coming"].Model.Hat.Highlight.Enabled = false
workspace.CutSceneArea["House Coming"].Maletin.Transparency = 1
workspace.CutSceneArea["House Coming"].Maletin.Highlight.Enabled = false
print("a")
end)
animtable.animation:GetMarkerReachedSignal("Hat"):Connect(function()
npc1["Meshes/FedoraAccessory"].Handle.Highlight.Enabled = false
npc1["Meshes/FedoraAccessory"].Handle.Transparency = 1
workspace.CutSceneArea["House Coming"].Model.Hat.Transparency = 0
workspace.CutSceneArea["House Coming"].Model.Hat.Highlight.Enabled = true
print("bruh")
end)
animtable.animation:GetMarkerReachedSignal("maletin"):Connect(function()
npc1.Maletin.Highlight.Enabled = false
npc1.Maletin.Transparency = 1
workspace.CutSceneArea["House Coming"].Maletin.Transparency = 0
workspace.CutSceneArea["House Coming"].Maletin.Highlight.Enabled = true
print("bruh2")
end)
animtable.animation:GetMarkerReachedSignal("damn"):Connect(function()
player.PlayerGui.Text.Enabled = true
player.PlayerGui.Text.Background.Karl.Visible = true
task.spawn(function()
game.ReplicatedStorage.Karl.Value = "mhhh.."
task.wait(3)
game.ReplicatedStorage.Karl.Value = "maybe.."
task.wait(4)
game.ReplicatedStorage.Karl.Value = "ill think of it later..."
task.wait(3)
effect.TintColor = Color3.new(1,1,1)
player.PlayerGui.Text.Enabled = false
player.PlayerGui.Text.Background.Karl.Visible = false
end)
end)
Connection = RunService.RenderStepped:Connect(function(DT)
local NewDT = DT * 60
FrameTime += NewDT
local NeededFrame = CinematicsFolder.Frames:FindFirstChild(tonumber(math.ceil(FrameTime)))
if NeededFrame then
char.Humanoid.AutoRotate = false
Camera.CFrame = npc1.HumanoidRootPart.CFrame * NeededFrame.Value
if char:WaitForChild("Humanoid").Health <= 1 then
Connection:Disconnect()
char.Humanoid.AutoRotate = true
Camera.CameraType = Enum.CameraType.Custom
Camera.CFrame = CurrentCameraCFrame
end
else
Connection:Disconnect()
char.Humanoid.AutoRotate = true
Camera.CameraType = Enum.CameraType.Custom
Camera.CFrame = CurrentCameraCFrame
end
end)
Connection2 = RunService.RenderStepped:Connect(function(DaT)
if CinematicsFolder.FOV then
local NewaDT = DaT * 60
fov += NewaDT
local neededfov = CinematicsFolder.FOV:FindFirstChild(tonumber(math.ceil(fov)))
if neededfov then
if char then
Camera.FieldOfView = neededfov.Value
elseif char:WaitForChild("Humanoid").Health <= 1 then
Camera.FieldOfView = currentfov
end
else
Connection2:Disconnect()
Camera.FieldOfView = currentfov
end
end
end)
end)
end
Cinematic()
so that the thing we want to focus on is the :GetMarkerReachedSignal
events and when the animations is playing
and i make sure that everything was alright but im still getting all like delay and not at the same time how i wanted to be. here a video of how is the problem: