Head Bob 1st Person with Arms Legs and Torso

Hello! I am typically a builder so I have no idea what to do here, the head bob looks really wierd as it doesnt look attached to the head, I want to know if there is a way I can make it look more attached to the body but still shaking.

robloxapp-20201216-1754249.wmv (1.1 MB)

Thanks in advance.

Off-Topic

Use gyazo gifs so people don’t have to download files - from my experience, they dislike doing so.

I’m quite confused? What is it that you want to achieve, a camera bobble whenever the player moves?

It already bobbles, and it would look fine if I had not made it so you can see arms legs and the torso, the torso goes up and the head does not so it ends up looking really wierd.

I just want it to bobble, but more naturally.

Oh, do you want a completely new script or your script modified? share your script if you’d like it modified.

I dont mind, I will send my script.

local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid

player.CameraMaxZoomDistance = 0.5
camera.FieldOfView = 100
humanoid.CameraOffset = Vector3.new(0, 0, -1)

for childIndex, child in pairs(character:GetChildren()) do
if child:IsA(“BasePart”) and child.Name ~= “Head” then

	child:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
		child.LocalTransparencyModifier = child.Transparency
	end)

	child.LocalTransparencyModifier = child.Transparency

end

end

camera:GetPropertyChangedSignal(“CameraSubject”):Connect(function()
if camera.CameraSubject:IsA(“VehicleSeat”) then
camera.CameraSubject = humanoid
end
end)

1 Like

Dont really know what happened there.

local RunService = game:GetService("RunService")
 
local playerModel = script.Parent
local humanoid = playerModel:WaitForChild("Humanoid")
 
local function updateBobbleEffect()
	local now = tick()
	if humanoid.MoveDirection.Magnitude > 0 then -- Are we walking?
		local velocity = humanoid.RootPart.Velocity
		local bobble_X = math.cos(now * 9) / 5
		local bobble_Y = math.abs(math.sin(now * 12)) / 5
		
		local bobble = Vector3.new(bobble_X,bobble_Y,0) * math.min(1, velocity.Magnitude / humanoid.WalkSpeed)
		humanoid.CameraOffset = humanoid.CameraOffset:lerp(bobble,.25)
	else
		-- Scale down the CameraOffset so that it shifts back to its regular position.
		humanoid.CameraOffset = humanoid.CameraOffset * 0.75
	end
end
 
-- Update the effect on every single frame.
RunService.RenderStepped:Connect(updateBobbleEffect)

You can mess around with the settings as you wish, it will look realistic at some point.
Developer Wiki source, by the way.

2 Likes

Thank you alot. (30 000000000000000)

1 Like

Instead of writing 30, just heart the replies as a sign that you’ve read it. “30” can get you moderated, so I wouldn’t risk it. Just some feedback

1 Like