Tweening Camera Offset Problem

Hello,

I’m facing an issue with the camera that I am unable to solve. I’ve searched high and low for results, but to no avail. Here is what’s happening:

  • This video displays the camera glitch every time I press ‘Shift+C’ while moving.

Here Is My Script:

function ChangeCameraOffset(Offset)
	if not char then char = plr.Character or plr.CharacterAdded:Wait() end
	local Humanoid = char:WaitForChild("Humanoid")

	local Tween = TweenService:Create(Humanoid, TweenInfo.new(0.1), {CameraOffset = Offset})
	Tween:Play()
end

uis.InputBegan:Connect(function(input, gameProcessedEvent)
	if input.KeyCode == Enum.KeyCode.C and uis:IsKeyDown(Enum.KeyCode.LeftShift) and DB == false and tick()-RollStartTime > .75 and hum.MoveDirection.Magnitude > 0 then
		ChangeCameraOffset(Vector3.new(0, -2, 0))
		hum.JumpPower = 0
		anim:Stop()
		Sliding = true
		RollTrack:Play()
		RollStartTime = tick()
		local dirVec = workspace.CurrentCamera.CFrame.LookVector
		RollDirection = (dirVec*Vector3.new(1,0,1)).unit
		DB = true
		RollTrack:Stop()
		wait(1)
		Sliding = false
		ChangeCameraOffset(Vector3.new(0, 0.475, 0))
		hum.JumpPower = 37
		wait(1)
		DB = false
	end
end)

Resources:

1 Like

Hey @xxxrazorfire12!

I’m not really sure what your issue is. I can see that your camera is behaving weirdly but considering you haven’t given me any context on what it’s supposed to look like I can’t really discern your problem.

You can’t just say “Here’s my issue” and post a video and expect anyone to understand.

Whats more is that script you posted isn’t complete and you haven’t posted the error message.
You’re giving me very very little to work with.

It’s supposed to tween the humanoid’s camera offset, hopefully achieving a crawling camera. But it doesn’t as you can see in the video.

Thank you for your time and effort, I’ve found a work around.