How do I smoothly move between camera positions?

My scene is set up as followed:
-When the player joins the game, their camera is set to a camera part (already set this up)
-Then, there are 2 other blocks, Map and Ticket

What I need to do is be able to transition smoothly between each camera point using key binds. Ticket is T, and Map is M. Smoothly means not teleporting to the camera position, but transitioning.

1 Like

You can use TweenService for this

1 Like

Use TweenService to tween the camera’s CFrame to the part’s CFrame.

It would look something like this:

local tweenService = game:GetService("TweenService")

local camera = workspace.CurrentCamera

local mapCameraPart = workspace.MapCameraPart --// Change this to the location and name of the part. This is just an example
ocal ticketCameraPart = workspace.TicketCameraPart --// Change this to the location and name of the part. This is just an example

local info = TweenInfo.new(1 --[[Change this to how long you want it to take. This is in seconds]], Enum.EasingStyle.Linear --[[Change this to your preferred EasingStyle]], Enum.EasingDirection.Out)

local mapCameraTween = tweenService:Create(camera, info, {CFrame = mapCameraPart.CFrame})
local ticketCameraTween = tweenService:Create(camera, info, {CFrame = ticketCameraPart.CFrame})

mapCameraTween:Play() --// Use this line to play the tween when you want to
ticketCameraTween:Play() --// Use this line to play the tween when you want to
2 Likes

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