Move camera down when player lands

Hey everyone! I’m trying to move the player camera down when he lands, and I kinda of achieved it by following this script:

local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
tween_ser = game:GetService("TweenService")
function MagicBubble(offset)
	local To = tween_ser:Create(humanoid,TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.In),{CameraOffset = humanoid.CameraOffset - Vector3.new(0,offset,0)})
	local From = tween_ser:Create(humanoid,TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),{CameraOffset = humanoid.CameraOffset})
	To:Play()
	wait(.2)
	From:Play()
	From.Completed:Wait()
end


humanoid.StateChanged:Connect(function(old,new)
	if new == Enum.HumanoidStateType.Landed then
		MagicBubble(1)
	end	
end)

While it works, it looks kinda bad, because if you take a closer look the CameraOffset tween is being played after the character lands

I tried playing around with easing styles, but the main problem still is this:

CameraOffset tween is being played after the character lands

Thank you in advance!

1 Like

In my opinion, it looks like the Tween starts playing right when the character lands, but perhaps the speed is just too slow?

I suggest making the Tween shorter, and maybe making the EasingStyle remain Linear? Maybe that will look more responsive.

Also, set Reverse to true, that way you don’t have to run two Tweens separate from each other.

1 Like

Sometimes the solutions is something very simple… :sweat_smile:
It looks way better now, thank you sir.

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