I have a script to make your camera shake the closer you get to a part, but the camera ends up turning sideways since it doesn’t try to stay centered.
I tried a couple of things, but nothing worked. Does anyone have any ideas how to fix this?
while task.wait() do
if workspace:FindFirstChild:("Entity") then
local intensity = 20
local range = 120
local dist = game.Players.LocalPlayer:DistanceFromCharacter(workspace.Entity.WorldPivot.Position)
local cam = workspace.Camera
local clamp = math.clamp(1 + (intensity - 0.1)*(1-(dist/range)), 0.1, intensity)
cam.CFrame *= CFrame.Angles(math.random(1 - clamp, clamp) / 500, math.random(1 - clamp, clamp) / 500, math.random(1 - clamp, clamp) / 500)
end
end