Camera go down more when landing?

i want to make a action game which is first person, how would I make it so that the player lands having the camera go down a little then go back to the normal height? for example:

when the player lands on the truck the player gets to have the camera down
(I thought about using animations but there isn’t a landing animation)

2 Likes

I believe this will work put it in startercharacterscripts

1 Like

this doesn’t really go down, instead it just shakes

1 Like

Hi!
Hm… As I understand it, you want the camera to “shake” a little after the fall?

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.3),{CameraOffset = humanoid.CameraOffset - Vector3.new(0,offset,0)})
	local From = tween_ser:Create(humanoid,TweenInfo.new(0.3),{CameraOffset = humanoid.CameraOffset})
	To:Play()
	To.Completed:Wait()
	From:Play()
	From.Completed:Wait()
end


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

If im not wrong you could just change the HumanoidOffset in the Y axis when the Humanoid’s State Changes to Landed.

EDIT : For Smooth interpolation of the HumanoidOffset , you could use a for loop or tweenservice. To detect Humanoid State Change , use the Event Humanoid.StateChanged which returns the old and new state and check whether the new state is Landed.

Humanoid.StateChanged:Connect(function(_,new)
 if new == Enum.HumanoidStateType.Landed then
  -- Change Humanoid offset here
  print("Landed")
 end
end)
1 Like