I’m quite embarrassed to admit that I need some help after previously getting help from people.
Context: I’m attempting to create a cutscene that triggers when a player joins the game.
Script:
local RunService = game:GetService("RunService")
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Camera = workspace.Camera
function Cinematic()
local CinematicsFolder = Game.ServerStorage.MoonAnimatorExports.TEST_Camera.Frames -- Path to your folder!
local CurrentCameraCFrame = workspace.CurrentCamera.CFrame
Camera.CameraType = Enum.CameraType.Scriptable
local FrameTime = 0
local Connection
Connection = RunService.RenderStepped:Connect(function(DT)
local NewDT = DT * 60
FrameTime += NewDT
local NeededFrame = CinematicsFolder.Frames:FindFirstChild(tonumber(math.ceil(FrameTime)))
if NeededFrame then
Character.Humanoid.AutoRotate = false
Camera.CFrame = NeededFrame.Value
else
Connection:Disconnect()
Character.Humanoid.AutoRotate = true
Camera.CameraType = Enum.CameraType.Custom
Camera.CFrame = CurrentCameraCFrame
end
Game.Players.PlayerAdded:Connect(Cinematic)
end)
end
Disclaimer: This is not my script. I’ve only written parts to call the function and the path to my folder. The original creator of the script is linked here.
I’ve also looked at the Script output and found nothing relating to the actual script, leading me to think that I messed up with calling the function.
If anyone could point out, or potentially fix what is wrong with this script, it’ll be greatly appreciated.
The thing with Codes Otaku Cutscene plugin is that its very limited compared to Moon Animator. Hopefully I can find a fix on this. Is there anything else that you see potentially wrong with this script? I’ve seen several games (Such as Entry Point) use cutscenes with moon animator. And apparently the script works for everyone else BUT myself.
Ok you cant access serverstorage from a local script… move the folder in there to ReplicatedStorage and change your reference in the script to that location:
Still doesn’t work. As of now, it’s 10 PM, and I have to go. I’ll check on this topic when I’m available. Thanks for your dedication to fix my problem!
local RunService = game:GetService("RunService")
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Camera = workspace.Camera
function Cinematic()
local CinematicsFolder = game.ReplicatedStorage.MoonAnimatorExports.TEST_Camera.Frames -- Changed 'ServerStorage' to 'ReplicatedStorage'
local CurrentCameraCFrame = workspace.CurrentCamera.CFrame
Camera.CameraType = Enum.CameraType.Scriptable
local FrameTime = 0
local Connection
Connection = RunService.RenderStepped:Connect(function(DT)
local NewDT = DT * 60
FrameTime += NewDT
local NeededFrame = CinematicsFolder.Frames:FindFirstChild(tonumber(math.ceil(FrameTime)))
if NeededFrame then
Character.Humanoid.AutoRotate = false
Camera.CFrame = NeededFrame.Value
else
Connection:Disconnect()
Character.Humanoid.AutoRotate = true
Camera.CameraType = Enum.CameraType.Custom
Camera.CFrame = CurrentCameraCFrame
end
end)
end
game.Players.PlayerAdded:Connect(Cinematic) -- Moved PlayerAdded Event outside the function, which should make everything function now.