Hello, here is a script I modified which sways your camera. It works very well. Here is the script:
Select the intensity, smoothness, and speed.
Here is a video of it
However for a less noticeable affect you can change it’s intensity lower
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local camera = workspace.CurrentCamera
local speed = 3
local intensity = 0.8
local smoothness = 0.2
local pitchThreshold = 30 -- Adjust this to change the pitch threshold where intensity changes
local cameraMoving = false
local lastCameraCFrame = camera.CFrame
UserInputService.InputEnded:Connect(function(input, gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.MouseMovement then
cameraMoving = false
lastCameraCFrame = camera.CFrame
end
end)
RunService.RenderStepped:Connect(function()
local t = tick()
local x = math.cos(t * speed) * intensity
local y = math.sin(t * speed) * intensity
local z = -10
local pitch = math.deg(math.asin(camera.CFrame.LookVector.Unit.Y))
local pitchIntensity = intensity
if pitch < -pitchThreshold then
pitchIntensity = 0 -- set to 0 if below threshold
elseif pitch > pitchThreshold then
pitchIntensity = intensity * 2
end
if cameraMoving then
x = x * pitchIntensity
y = y * pitchIntensity
local cf = CFrame.new(Vector3.new(x, y, 0), Vector3.new(x*0.95, y*0.95, z)) + camera.CFrame.Position
camera.CFrame = camera.CFrame:Lerp(cf * camera.CFrame.Rotation, smoothness)
else
-- smoothly return to last camera position if camera is not moving
camera.CFrame = camera.CFrame:Lerp(lastCameraCFrame, smoothness)
end
end)