Realistic jumping

hello! im creating a advanced movement system and im adding details now, one of the details i’d like added is when you jump then land it goes like up and down, if you know what i mean lol. i know theres a forum about this, i just couldnt wrap my head around how to implement it into my code.

any help appreciated

2 Likes

I don’t really know how you’d make it but I think you could probably get an ok effect by adding AssemblyLinearVelocity to the HumanoidRootPart after they’ve touched the ground again

example

local Humanoid = …
local HumanoidRootPart = …

-- detect the jump
Humanoid.StateChanged:Connect(function(state)
   if state == Enum.HumanoidStateType.Landed then
      -- apply AssemblyLinearVelocity
      HumanoidRootPart.AssemblyLinearVelocity = Vector3.new(0, 5, 0)
   end
end)

this is just an example. it probably doesn’t work / doesn’t work well

Maybe you could make some landing animation and make a script that detects a player landing after a jump. When the player lands, the animation is ran.

yeah but idk if you can animate the camera

i mean ig that’d work but im kinda thinking of tilting the camera instead

Wdym by that? Like a head bobbing movement sorta thing?

local Humanoid = …
local HumanoidRootPart = …

-- detect the jump
Humanoid.StateChanged:Connect(function(state)
   if state == Enum.HumanoidStateType.Landed then
      -- apply AssemblyLinearVelocity
      HumanoidRootPart.AssemblyLinearVelocity = Vector3.new(0, 5, 0)
   end
end)

and I’m gonna add my code section from my first post here

yeah exactly but i have no idea how to do it, ive tried tweening the cframe, but it leaves the rest of the camera behind

1 Like

Uhh I don’t really know the math behind something like this so I’ll just link a resource

right, but the doc uses cameraoffset and im pretty sure you cant use offset to change the rotation

Didn’t check the devforum for a while mb

Yeah I don’t think so either since it accepts a Vector3

source: Humanoid | Documentation - Roblox Creator Hub

It just kinda moves the camera from side to side, and up and down to give the illusion that its rotation (I think)

I found this but it’s pretty crazy with all the math it’s got but it does utilize Rotation / Orientation which is what you wanted

In this one I basically re-wrote Cbob made by IAmDevForumMember. It’s a solid routine. I’ve added a wide range of options and clamped everything from over doing it. dxxmed is right about the main settings. Basically it lerps and the intensity grows with velocity. Posted this awhile back but it’s still super smooth. Having the intensity change with velocity is why all the math.

1 Like