How to tween camera back to humanoid?

Alright so, i made a a script where it tweens the camera to a brick (npc as an example aka shop gui type stuff) but when i try to tween back the camera to the humanoid camera i kinda get confused on how to do that, is anybody willing to help me out?

1 Like

You should save the player’s CFrame to a variable before tweening it.

local cameraCFrame = workspace.CurrentCamera.CFrame
-- add your tween here

to revert to the original CFrame:

local tween = tweenService:Create(workspace.CurrentCamera, TweenInfo.new(0.25), {CFrame = cameraCFrame})
tween:Play()
tween.Completed:Wait()
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
workspace.CurrentCamera.CameraSubject = players.LocalPlayer.Character.Humanoid
4 Likes

I will try soon when i wake up, currently 5 am :sweat_smile: thanks anyway