I've made a local script that plays a cutscene when a player starts the game, the camera stays in the same position at the end. But I want to make a button that returns to the player's default camera position. how can I do this? I've tried disabling the local script won't it won't work.
Here is the cutscene local script:
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)

3 comments
The first one to answer the question correctly will get a custom free model from me, it has to be used for Roblox though.
Instead of disabling the local script why don't you just set the camera type back to what it originally is in your game.
how do I do that