Hello, I’m pretty new at working with cameras and I need a bit of help. I have my base idea set up, but it has an abrupt start and I would like it to be smoother. Also, the way I did it is most definitely not the best way and I’d like to know a better way.
What I currently have:
https://i.imgur.com/3GYMyns.mp4
The code that runs it:
button.MouseButton1Click:Connect(function()
local camPos = Instance.new("Part")
camPos.CFrame = currentcamera.CFrame + Vector3.new(0,100,0)
camPos.Orientation = Vector3.new(-30, 0, 0)
camPos.Anchored = true
camPos.CanCollide = false
camPos.Transparency = 1
local camPos2 = camPos:Clone()
camPos2.Orientation = Vector3.new(-30, 90, 0)
local camPos3 = camPos:Clone()
camPos3.Orientation = Vector3.new(-30, 180, 0)
local camPos4 = camPos:Clone()
camPos4.Orientation = Vector3.new(-30, -90, 0)
local camCFrame = currentcamera.CFrame
local camDistance = camCFrame.p - playerModel.Head.Position
currentcamera.CameraType = Enum.CameraType.Scriptable
local FadeInfo1 = TweenInfo.new(2 , Enum.EasingStyle.Quint , Enum.EasingDirection.InOut)
local goal0 = {FieldOfView = 45}
local goal1 = {CFrame = camPos.CFrame}
local Tween0 = TweenService:Create(currentcamera , FadeInfo1 , goal0)
local Tween1 = TweenService:Create(currentcamera , FadeInfo1 , goal1)
Tween0:Play()
Tween1:Play()
wait(2)
active = true
while active do
local FadeInfo2 = TweenInfo.new(5 , Enum.EasingStyle.Linear , Enum.EasingDirection.InOut)
--local goalrot = currentcamera.CFrame * CFrame.Angles(0, math.rad(180), 0)
local goal2 = {CFrame = camPos2.CFrame}
local Tween2 = TweenService:Create(currentcamera , FadeInfo2 , goal2)
local goal3 = {CFrame = camPos3.CFrame}
local Tween3 = TweenService:Create(currentcamera , FadeInfo2 , goal3)
local goal4 = {CFrame = camPos4.CFrame}
local Tween4 = TweenService:Create(currentcamera , FadeInfo2 , goal4)
local goal5 = {CFrame = camPos.CFrame}
local Tween5 = TweenService:Create(currentcamera , FadeInfo2 , goal5)
Tween2:Play()
wait(5)
Tween3:Play()
wait(5)
Tween4:Play()
wait(5)
Tween5:Play()
wait(5)
end
end)
I would greatly appriciate some help in this. If you could make it so the camera smoothly pans up and starts rotating at the same time, it would be great. Thank you.