Script says that there is no camera offset in humanoid

I’ve started working on a horror game recently and I am trying to implement a view bobbing system. I keep getting the same error. I couldn’t find a solution on developer hub.

code:


local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local cam = game.Workspace.CurrentCamera
local up = 1
local bob = 0
while true do
	if hum.MoveDirection.X ~= 0 or hum.MoveDirection.z ~= 0 then
		bob = bob + up
		hum.CameraOffest = Vector3.new(0,.01,0) * up + hum.CameraOffset
	else
		
	end
	
	
	if bob >= 5 then
		up = -1
	end
	if bob <= 5 then
		up = 1
	end
	
	
	
	wait(.01)
end

error:

CameraOffest is not a valid member of Humanoid "Workspace.elfy1028.Humanoid"  -  Client - LocalScript:9
1 Like

easy, you spelled CameraOffset wrong, next time check for spelling mistakes on scripts bfor posting topics here

1 Like