How do i make a camera bobbing?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

camera bobbing that is pretty similar to the one used in Backrooms : Escape Together
also i want it to be VERY smooth

  1. What is the issue? Include screenshots / videos if possible!

i dont really know the basics to make a camera bobbing but anyways
here is a video of the gameplay so you know what i mean

timeline is 0:27

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

there are no topics about a camera bobbing similar to the one i want

1 Like

Camera bobbing is a method of manipulating the camera using trig functions like sine and cosine. To make the camera realistic and stuff. There are plenty of tutorials on YouTube to learn how to do this. There are also free models in the toolbox to help you.

1 Like

But i want it to look exactly like in the video. And i dont know what are you talking about. What is sine and cosine?

So if you learned geometry, sine is the ratio of the side opposite to an angle in a right triangle to the hypotenuse and cosine is basically sine but adjacent to the hypotenuse but pretty much the same.

But like i dont really know how to script… So…?

So…

  • Learn with the Roblox Creator Documentation (and various other resources).
  • Or hire someone to do it for you with the talent hub.
  • Or maybe if you have a good scripter friend they’ll be quite nice and try it for free.
  • There’s also free models/plugins you can have a look at and modify (be sure they don’t have viruses).
  • And, relatively unlikely, but sometimes people give you code on here too in replies. But for something a bit time-consuming such as custom camera bobbing, almost certainly not, hence the above.

There’s usually some YouTube tutorial for this stuff too, but I assume you’ve tried those already and came here after they didn’t work.

Best of luck!

P.S. Probably more specifically useful:

In this video, if the camera’s position values was calibrated vs the head’s position as the head “bobs” normally … the camera would follow it. It really looks like that’s what I’m seeing here, as it also moves a bit sideways, just as the head movement would be.

If not you may want to try out a mod or two …
This looks like something you may like: Creating a Simple, Realistic Camera (With View Bobbing, Dynamic Blur, & Sprinting)

Or possibly … EZ Camera Shake ported to Roblox
This one is simply epic for camera effects. You would need to script this in while you move.

2 Likes

is hiring someone costs robux? And what hiring someone does? wait will i get free robux from it…?

What? I don’t know how you inferred that from my comment…
Hiring someone from the Talent Hub means you pay them Robux to help create what you want, so long as it can be done. I can’t make it any simpler than that.

--CBob (LocalScript) StarterCharacterScripts 
--original/rewrite IAmDevForumMember/2112Jay

task.wait(3) 
local Camera = workspace.CurrentCamera
local RunService = game:GetService("RunService")
local LocalPlayer = game:GetService("Players").LocalPlayer
local UserInputService = game:GetService("UserInputService")
local Root = LocalPlayer.Character:WaitForChild("HumanoidRootPart")
local angleX, x, y, tilt, vX, vY, sX, sY = 0, 0, 0, 0, 0, 0, 10, 10
local TouchEnabled = UserInputService.TouchEnabled
local Mouse = LocalPlayer:GetMouse()
local randomX, randomY = nil, nil
local function lerp(v1, v2, t)
	return v1 + (v2 - v1) * t
end

RunService.RenderStepped:Connect(function(dt)
	local velocity = Root.Velocity.magnitude
	if velocity > 0.02 then dt *= 60 randomX = math.random(1, 2) randomY = math.random(1, 2) --x(10,15), y(5,10)
		vX = dt <= 2 and lerp(vX, math.cos(tick() * 0.5 * randomX) * (math.random(5, 20) / 200) * dt, 0.05 * dt) or 0
		vY = dt <= 2 and lerp(vY, math.cos(tick() * 0.5 * randomY) * (math.random(2, 10) / 200) * dt, 0.05 * dt) or 0

		Camera.CFrame *= CFrame.Angles(0, 0, math.rad(angleX))
			* CFrame.Angles(math.rad(math.clamp(x * dt, -0.15, 0.15)), math.rad(math.clamp(y * dt, -0.5, 0.5)), tilt)
			* CFrame.Angles(math.rad(vX), math.rad(vY), math.rad(vY * 10))

		tilt = math.clamp(lerp(tilt, -Camera.CFrame:VectorToObjectSpace((Root and Root.Velocity or 
			Vector3.new()) / math.max(LocalPlayer.Character.Humanoid.WalkSpeed, 0.01)).X * 0.05, 0.1 * dt), -0.05, 0.05)

		if not TouchEnabled and dt < 2 then
			angleX = lerp(angleX, math.clamp(UserInputService:GetMouseDelta().X / dt * 0.15, -2.5, 2.5), 0.25 * dt)
		end 
		
		x = lerp(x, math.sin(tick() * sX) / 5 * math.min(1, sY / 10), 0.25 * dt)
		y = velocity > 1 and lerp(y, math.cos(tick() * 0.5 * math.floor(sX)) * (sX / 200), 0.25 * dt) or lerp(y, 0, 0.05 * dt)
		sX, sY = velocity > 12 and 20 or (velocity > 0.1 and 12 or 0), velocity > 0.1 and 18 or (velocity > 0.1 and 14 or 0)
	end
end)

Mess with the randomX and randomY for more bobbing/tilt effect.

10 Likes

but it works inverted when i am the one hired right?

1 Like

it works perfect bc it changes the speed of it when sprinting. How can i change the shaking power when standing?
And also thank you very very very very very very very very very very much for this script but you should tell me how to decrease the shaking while standing and also the shaking speed

oh btw while making a script put credits at the start

The values can be changed. Just mess around with it. That program started off from a script I saw here, . Modified, and restructured to be more efficient and readable. I tried to find one like the video view.

Found it again … this was posted by: IAmDevForumMember
In a much larger form … I tweaked it about as much as I could.

1 Like

i think i just figured it out… so randomX and randomY are for the shaking right? so if i make them small it wont be a big shake

yep, it should and I need 30 words to reply here.

1 Like

also would you help me if i will make any other topic? but you dont need to.

I think Roblox wants you to make a new topic for each question.

1 Like

Also did you edit the original script?

The original script is from this post … Configurable Head Bobbing Script
Super hard to read but also super good programming with lerp.
I gave it some love and rewrote it …

2 Likes