this is what’s happening right now: (compressed because devforum.roblox.com limits files to 10MB!!!)
and i nicely tell the camera to tilt to the right (or left)
sorry if this code has a lot of repetition, but i think it works :^)
local tService = game:GetService("TweenService")
local tweenParameters = TweenInfo.new(
0.15,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out
)
local cameraFunctions = {
FirstComboSwing = function(camera: Camera)
local beforeShiftCFrame = camera.CFrame
local shiftCFrame = CFrame.Angles(math.rad(3), math.rad(-3), math.rad(-45))
local afterShiftCFrame = beforeShiftCFrame * shiftCFrame
camera.CFrame = afterShiftCFrame
local shiftCameraBack = tService:Create(camera, tweenParameters, {CFrame = beforeShiftCFrame})
shiftCameraBack:Play()
end,
SecondComboSwing = function(camera: Camera)
local beforeShiftCFrame = camera.CFrame
local shiftCFrame = CFrame.Angles(math.rad(3), math.rad(3), math.rad(45))
local afterShiftCFrame = beforeShiftCFrame * shiftCFrame
camera.CFrame = afterShiftCFrame
local shiftCameraBack = tService:Create(camera, tweenParameters, {CFrame = beforeShiftCFrame})
shiftCameraBack:Play()
end,
ThirdComboSwing = function(camera: Camera)
local beforeShiftCFrame = camera.CFrame
local shiftCFrame = CFrame.Angles(math.rad(-3), math.rad(-3), math.rad(-45))
local afterShiftCFrame = beforeShiftCFrame * shiftCFrame
camera.CFrame = afterShiftCFrame
local shiftCameraBack = tService:Create(camera, tweenParameters, {CFrame = beforeShiftCFrame})
shiftCameraBack:Play()
end,
HeavySwing = function(camera: Camera)
local beforeShiftCFrame = camera.CFrame
local shiftCFrame = CFrame.Angles(math.rad(5), math.rad(-5), math.rad(0))
local afterShiftCFrame = beforeShiftCFrame * shiftCFrame
camera.CameraType = afterShiftCFrame
local shiftCameraBack = tService:Create(camera, tweenParameters, {CFrame = beforeShiftCFrame})
shiftCameraBack:Play()
end,
}
local cameraManipulationModule = {}
function cameraManipulationModule.Manipulate(camera: Camera, manipulationType: string)
cameraFunctions[manipulationType](camera)
end
return cameraManipulationModule