How Do You Make a Camera Tween?

Hello. For my main menu I want the camera that we are using to tween to a certain position. Whenever I do this it ends up looking in a completely different way.

This is my script:

local Player = game.Players.LocalPlayer
local tweenService = game:GetService("TweenService")
local Camera = game.Workspace.CurrentCamera
local MenuCam = game.Workspace:WaitForChild("MenuCam")
local Process = false

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PlayPressed = ReplicatedStorage:WaitForChild("PlayPressed")

wait(game:IsLoaded())
MenuCam.Transparency = 1
Camera.CameraType = Enum.CameraType.Scriptable
Camera.FieldOfView = 50

local BlurEffect = Instance.new("BlurEffect")
BlurEffect.Size = 0
BlurEffect.Parent = game.Lighting

local Black = tweenService:Create(script.Parent:WaitForChild("Black"), TweenInfo.new(2, 
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out),
	{Transparency = 0})
local UnBlack = tweenService:Create(script.Parent:WaitForChild("Black"), TweenInfo.new(2, 
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out),
	{Transparency = 1})
local Blur = tweenService:Create(BlurEffect, TweenInfo.new(2, 
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out),
	{Size = 20})
local UnBlur = tweenService:Create(BlurEffect, TweenInfo.new(1, 
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out),
	{Size = 0})

script.Parent:WaitForChild("GameMusic").Playing = true

script.Parent.PlayButton.MouseButton1Click:Connect(function()
	if Process == true then return end
	Process = true
	Black:Play()
	wait(3)
	Camera.CameraType = Enum.CameraType.Custom
	Camera.FieldOfView = 70

	script.Parent.PlayButton:Destroy()
	script.Parent.GameTitle:Destroy()
	script.Parent.CuteBuddy:Destroy()
	script.Parent.SpeechBubble:Destroy()
	script.Parent.SpeechLabel:Destroy()
	script.Parent:WaitForChild("GameMusic").Playing = false
	Player.PlayerGui.RollGui.Enabled = true
	print("RollUi enabled")
	Player.PlayerGui.SideMenu.Enabled = true
	print("SideUi enabled")
	PlayPressed:FireServer()  -- Notify the server
	UnBlack:Play()
end)

If anyone would be so kind to tell me how to achieve this, it would be greatly appreciated.
Thank you so much,
Antlers

first set it to scriptable (cameramode) after that ,

after that tween the CFrame to whatever cframe u need and that’s it.

ᐉ ᐱpᐈ ᐪᐷᔆ ᐶᑊpᐈd.

1 Like

local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")

-- Get the local player and their camera
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera

-- Define the start and end CFrame for the camera
local startCFrame = camera.CFrame
local endCFrame = CFrame.new(Vector3.new(0, 50, 0), Vector3.new(0, 0, 0))

-- Define the tween information
local tweenInfo = TweenInfo.new(
    2, -- Time (seconds)
    Enum.EasingStyle.Quad, -- EasingStyle
    Enum.EasingDirection.Out, -- EasingDirection
    0, -- RepeatCount (0 = no repeat)
    false, -- Reverses (false = no reverse)
    0 -- DelayTime (seconds)
)

-- Create the tween
local tween = TweenService:Create(camera, tweenInfo, {CFrame = endCFrame})

-- Play the tween
tween:Play()

-- Optionally, add a callback to perform an action when the tween completes
tween.Completed:Connect(function()
    print("Camera tween completed!")
end)

1 Like

Thank you so much! I’ll test it now This text will be blurred

1 Like

No problem and have fun and enjoying

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.