Hey there, so I was playing around with camera skewing, (I believe another word for it is Camera Matrix), and I tried using tween service to make a cool effect to my game.
Here is my code:
local Run = game:GetService("RunService")
local Cam = game.Workspace.Camera
local MAGIC_FORMULA = CFrame.new(0, 0, 0, 1, 0.125, 0, 0, 1, 0, 0, 0, 1)
local MAGIC_FORMULA2 = CFrame.new(0, 0, 0, 1, -0.125, 0, 0, 1, 0, 0, 0, 1)
local tweenservice = game:GetService("TweenService")
local movecamera1 = tweenservice:Create(Cam, TweenInfo.new(4, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out),{CFrame = Cam.CFrame * MAGIC_FORMULA})
local movecamera2 = tweenservice:Create(Cam, TweenInfo.new(4, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out),{CFrame = Cam.CFrame * MAGIC_FORMULA2})
--Run.RenderStepped:Connect(function()
-- Cam.CFrame = Cam.CFrame * MAGIC_FORMULA
--end)
while true do
movecamera1:Play()
wait(4)
movecamera2:Play()
wait(4)
end
For some reason, this doesn’t work, instead it gives me this result:
The result I want would look like this:
Obviously, this wouldn’t be anyway close to how I want it considering I’m dragging a slider to make this happen, but I like the look of the effect using tweenservice (to make it more smooth).
Any way to help me achieve this?