How do i smoothly tween my camera?

So im experimenting with the camera, and making cutscenes. Ive successfully managed to do that, but theres a bit of an issue i ran into


When i play the game, the camera doesnt tween the way i’d like it to, Instead of smoothly transitioning to point 2, it just kinda “snaps” there. Like in the blink of an eye its gone.

Heres the code

Camera Script
local camera = game:GetService("Workspace").CurrentCamera

local TweenService = game:GetService("TweenService")

local player = game:GetService("Players").LocalPlayer

local Point1 = game.Workspace.Point1

local character = player.Character or player.CharacterAdded:Wait()

repeat

wait()

camera.CameraType = Enum.CameraType.Scriptable

until camera.CameraType == Enum.CameraType.Scriptable

camera.CFrame = Point1.CFrame
Cutscene Script
local camera = game:GetService("Workspace").CurrentCamera

local TweenService = game:GetService("TweenService")

local player = game:GetService("Players").LocalPlayer

local Point1 = game.Workspace.Point1

local character = player.Character or player.CharacterAdded:Wait()

local Point2 = game.Workspace.Point2

local function TweenCamera()

local tweenInfo = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 1, true, 0)

local goal = {}

camera.CFrame = Point2.CFrame

local tween = TweenService:Create(camera, tweenInfo, goal)

tween:Play()

tween.Completed:Wait()

camera.CameraType = Enum.CameraType.Custom

end

wait(5)

TweenCamera()

Help would greatly be appreciated, thank you for your time :smiley:

4 Likes
local ts = game:GetService("TweenService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
local point1 = workspace:WaitForChild("Point1")

task.wait(3)
local tween = ts:Create(camera, TweenInfo.new(3), {["CFrame"] = point1.CFrame})
tween:Play()

https://gyazo.com/e5de2b6d450a06dc52767361a384e1c1

12 Likes

Try this page: EasingStyle | Roblox Creator Documentation

1 Like

This worked! thank you!! (oh just to clarify i didnt copy and paste your script, i just looked at what changed and implemented it :sweat_smile:)