Calculate an arbitrary point straight in front of the camera, adjust that point using a random vector, such as a vector whose components are a bunch of random frequency sine waves. Re-aim the camera at this updated vector.
It’s currently 11 pm and I don’t want to think about what I’m writing, but I managed to make something that works. I used the spring module to make it more smooth.
Here’s the script (with the spring module): LocalScript.rbxm (3.3 KB)
Or you can look at it here if you want:
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local camera = workspace.CurrentCamera
local Spring = require(script.Spring)
local CameraSpring = Spring.new(Vector3.zero)
CameraSpring.Speed = 10
CameraSpring.Damper = 0.75
local speed = 3
local intensity = 0.1
local z = -2
local random = Random.new()
RunService.RenderStepped:Connect(function(dt)
local t = os.clock()
local x, y = math.cos(t*speed) * intensity, math.sin(t*speed) * intensity
CameraSpring.Target = camera.CFrame.Position + Vector3.new(x, y, 0)
camera.CFrame = CFrame.new(CameraSpring.Position, CameraSpring.Position + Vector3.new(x*0.95, y*0.95, z))
end)
P.S. I think it won’t let you rotate the camera though.
You can just add your camera rotation here: