As well as some other method’s, nothing’s seems to have worked yet. Here’s my script.
local RunService = game:GetService("RunService")
local button = script.Parent.ImageButton
local Camera = game.Workspace.CurrentCamera
local Player = game:GetService("Players")
local Part = game.Workspace.Car.CutSceneCar.Camera
local isOn = false
button.MouseButton1Click:Connect(function()
wait()
if not isOn then
Camera.CameraType = Enum.CameraType.Scriptable
isOn = true
else
Camera.CameraType = Enum.CameraType.Custom
isOn = false
end
end)
RunService.RenderStepped:Connect(function()
if isOn then
Camera.CFrame = Part.CFrame
end
end)
-- return cam to player
wait(15) -- change to 65 after testing
Camera.CameraType = Enum.CameraType.Custom
Camera.CameraSubject = Player.LocalPlayer.Character.Humanoid
Camera.CameraType = Enum.CameraMode.LockFirstPerson
local RunService = game:GetService("RunService")
local Player = game:GetService("Players")
local button = script.Parent.ImageButton
local Camera = game.Workspace.CurrentCamera
local Part = game.Workspace.Car.CutSceneCar.Camera
local isOn = false
button.MouseButton1Click:Connect(function()
wait()
if not isOn then
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = Part.CFrame
isOn = true
else
Camera.CameraType = Enum.CameraType.Custom
isOn = false
end
end)
Part:GetPropertyChangedSignal("CFrame"):Connect(function()
if isOn then
Camera.CFrame = Part.CFrame
end
end)
-- return cam to player
wait(15) -- change to 65 after testing
Camera.CameraType = Enum.CameraType.Custom
Camera.CameraSubject = Player.LocalPlayer.Character.Humanoid
Figured out the problem was the loop changing the CFrame of the cam constantly, so all I had to do was make sure the loop stopped. Thanks for the help though!