sure. i’ll send the whole camera module i have
local UserInputService = game:GetService('UserInputService')
local TweenService = game:GetService('TweenService')
local rootpartinfo = TweenInfo.new(.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
local n_rootpartinfo = TweenInfo.new(.01, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
local fovininfo = TweenInfo.new(.3, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
local fovoutinfo = TweenInfo.new(.2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local CameraSystem = {}
function CameraSystem.LOCK_CAMERA(rootPart, camera, player, CURRENTROOTPARTTWEEN, bool)
TweenService:Create(camera, fovininfo, {FieldOfView = 50}):Play()
player.CameraMinZoomDistance = 8
player.CameraMaxZoomDistance = 8
--TweenService:Create(camera, lockinfo, {CFrame = camera.CFrame * CFrame.new(2.7,0.6,1)}):Play()
camera.CFrame = camera.CFrame * CFrame.new(3,0.8,.5)
local camLv = camera.CFrame.lookVector
local camRotation = math.atan2(-camLv.X, -camLv.Z)
--[[if player.Character.Humanoid.MoveDirection.Magnitude > 0 then
CURRENTROOTPARTTWEEN = TweenService:Create(rootPart, n_rootpartinfo, {CFrame = CFrame.new(rootPart.Position) * CFrame.Angles(0, camRotation, 0)}):Play()
else
CURRENTROOTPARTTWEEN = TweenService:Create(rootPart, rootpartinfo, {CFrame = CFrame.new(rootPart.Position) * CFrame.Angles(0, camRotation, 0)}):Play()
end]]
rootPart.CFrame = CFrame.new(rootPart.Position) * CFrame.Angles(0, camRotation, 0)
if CURRENTROOTPARTTWEEN then
CURRENTROOTPARTTWEEN:Play()
end
return CURRENTROOTPARTTWEEN
end
function CameraSystem.UNLOCK_CAMERA(camera, player, CURRENTROOTPARTTWEEN)
if camera.FieldOfView ~= 70 then
TweenService:Create(camera, fovoutinfo, {FieldOfView = 70}):Play()
end
player.CameraMinZoomDistance = 8
player.CameraMaxZoomDistance = 20
if CURRENTROOTPARTTWEEN then
CURRENTROOTPARTTWEEN:Stop()
end
end
function CameraSystem.RECOIL(recoiltime, recoilreturntime, recoilpower, recoilreturnpower, camera)
for i = 1, recoiltime do
--camera.CFrame = camera.CFrame:Lerp(camera.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(recoilpower-((recoiltime-i)/30)),0,0), 0.1)
camera.CFrame = camera.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(recoilpower-((recoiltime-i)/30)),0,0)
task.wait(0.0000000000001)
end
for i = 1, recoilreturntime do
camera.CFrame = camera.CFrame * CFrame.fromEulerAnglesXYZ(-math.rad(recoilreturnpower),0,0)
task.wait(0.001)
end
end
return CameraSystem