Free Camera sway script (First Person)

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)

12 Likes

This looks interesting. Could you include a video of it in action?

This is jankier than it is functional

1 Like

its intended for 1st person my bad.

here it is with low intensity:

here is it with high intensity:

GODLY INTENSITY

Yes.

1 Like

how did you get that animated furry ball on your screen?

i made a blender sphere
pasted my mutual’s profile pic onto it
made it spin
export to gif
paste into OBS as media overlay

1 Like

I made a plugin in inspiration of your furry ball.

https://create.roblox.com/marketplace/asset/13168789375/Game-Developer-Helper-V2

it gives motivation based on what you are selecting and spins a block on your screen. You can customize the image and the block shape as well as hide the block entirely.

4 Likes

oh my god this is actually incredible I love you i’d pay robux for this

does not work. even if i’m in 1st person r15 and 16, i’m stuck facing one position

it has to be in startercharacterscripts

k, but it still forces me to look at 1 angle of the camera

this looks like an april fool days script to me :smiling_face_with_tear:

it’s still unfunctional here even on StarterCharacterScripts
I’ve removed the lerping function at the end since this is still running in the RunService and it worked.