Camera bobbling effect not working in first person after attaching camera to head

So I made this camera bobbling effect →

the code is as follows

local runService = game:GetService("RunService")

local char = script.Parent

local humanoid = char:WaitForChild("Humanoid")

function updateBobbleEffect()
	local currentTime = tick()
	if humanoid.MoveDirection.Magnitude > 0 then
		local bobbleX = math.cos(currentTime * 7) * .47
		local bobbleY = math.abs(math.sin(currentTime * 7)) * .47
		local bobble =, bobbleY, 0)

		humanoid.CameraOffset = humanoid.CameraOffset:lerp(bobble, .50)
		humanoid.CameraOffset = humanoid.CameraOffset * .50


Now after using the Realism open source module to make my body parts visible, my bobbling effect is gone, likely due to the camera attaching itself to the head (which I want for other anims)
final product :
I tried several methods but I can’t seem to retain the bobbling effect while the camera is attached to the head, any help or corrections?

CameraBobble.rbxl (54.1 KB)

Here is a place file with realism working alongside a more advanced camera bobbling effect that also lerps the camera so the movement feels more fluid.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.