Now that I found a solution for clicking a button to activate a cutscene, I’m currently working on adding a camera system to my game. The system works by using a tool with a LocalScript inside; the tool is located in the StarterPack. The script is posted below, for reference. It’s connected to a part in Workspace named “Cam(#)”. However, for some unknown reason, the game isn’t compatible with this. If anyone has any solutions, I’d be happy to try them out.
Thank you.
--On the camera part, the stud is the front surface (where the Camera will face), and the inlet is the top surface.
local cameraPart = workspace.Cam1 --Replace with path of camera brick. Make camera brick invisible.
script.Parent.Equipped:Connect(function()
workspace.CurrentCamera.CameraSubject = cameraPart
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
workspace.CurrentCamera.CFrame = cameraPart.CFrame
workspace.CurrentCamera.FieldOfView = "25"
end)
script.Parent.Unequipped:Connect(function()
workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
workspace.CurrentCamera.FieldOfView = "70"
end)
You might have code that’s messing with the camera somewhere else. You can try this code and see if this fixes the problem:
local cameraPart = workspace.Cam1 --Replace with path of camera brick. Make camera brick invisible.
local connection
script.Parent.Equipped:Connect(function()
workspace.CurrentCamera.CameraSubject = cameraPart
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
if connection.Connected then connection:Disconnect() end
connection = workspace.CurrentCamera:GetPropertyChangedSignal("CameraType"):Connect(function()
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
workspace.CurrentCamera.CameraSubject = cameraPart
end)
workspace.CurrentCamera.CFrame = cameraPart.CFrame
workspace.CurrentCamera.FieldOfView = 25
end)
script.Parent.Unequipped:Connect(function()
workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
if connection.Connected then connection:Disconnect() end
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
workspace.CurrentCamera.FieldOfView = 70
end)
This code isn’t super great practice, though if this works and the other code doesn’t it means another script is messing with the camera.