So I've made a local script that plays a cutscene when the game runs, there Is this Guibutton that is deposed to reset the local player's camera back to its camera position. I've tried disabling the script, but you can't do that with a local script. So my next option is to reset the camera to it's default position. Keep in mind that I set the camera type to scriptable and the camera's mode is "LockFirstPerson" Thanks in advance and here are the scripts.

Local cutscene script which is in StarterGui:

local TweenService = game:GetService("TweenService") local camera = game.Workspace.Camera local PlayButton = script.Parent local cutsceneTime = 3 --this will change the length of your cutscene in seconds local tweenInfo = TweenInfo.new( cutsceneTime, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0 )

local function tween(part1,part2) camera.CameraType = Enum.CameraType.Scriptable camera.CFrame = part1.CFrame

local tween = TweenService:Create(camera, tweenInfo, {CFrame = part2.CFrame}) tween:Play()

PlayButton.MouseButton1Click:Connect(function() 

	camera.CameraType = Enum.CameraType.Custom
end)		

end

wait()

tween(Workspace.Test1, Workspace.Test2)

Local Guibutton script:

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()

-- Where I want to reset the camera back to its default position.

end)

1 comment

0

Im still waiting for my answer :(