I’m trying to make a jump system that is more realistic then the roblox jumping system but, im stuck on how to make the x and z values change correctly depending on if you are standing still or moving. I’ve tried using the HumanoidRootPart.Velocity the Humanoid.MoveDirection and some other things to get this right but I can’t seem to get it right.
This is my code
local function Jump() Values.Jumping = true
local CF = HumanoidRootPart.CFrame.LookVector
local NewPosition = HumanoidRootPart.Position + HumanoidRootPart.Velocity
JumpAnim.KeyframeReached:Connect(function(KeyFrmae)
if KeyFrmae == "Up" then
Humanoid.AutoRotate = false ; Humanoid.WalkSpeed = 0 ; BP.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
BP.Position = Vector3.new(NewPosition.X,HumanoidRootPart.Position.Y + 10,NewPosition.Z)
else if KeyFrmae == "Down" then
BP.MaxForce = Vector3.new(0,0,0) BP.Position = Vector3.new(0,0,0)
else if KeyFrmae == "Done" then
Humanoid.AutoRotate = true ; Humanoid.WalkSpeed = 16
wait(0.3) ; Values.Jumping = false
end
end
end
end)
JumpAnim:Play(0.3)
end
Really off-topic, but this thread was posted more than a year ago, just thought I should tell you in case you didn’t notice. The person who originally posted this also hasn’t been on for 9 months.