Roblox’s JumpHeight seems to be limited to a specific number, and even when changing it to an absurdly huge number it still does not jump high. Just a couple thousand studs.
Is there a way to bypass that limit or implement a better jumping system? I have tried BodyVelocities but I cannot find a way to detect when the player is at the peak of their jump and falling down.
--LocalScript .. StarterCharacterScripts
local plr = game:GetService("Players").LocalPlayer
local function onChar(char)
local root = char:WaitForChild("HumanoidRootPart")
local lastYVel = 0
while true do
task.wait(0.1)
local yVel = root.AssemblyLinearVelocity.Y
if lastYVel >= 0 and yVel < 0 then
print("Highest point reached, now falling")
end
lastYVel = yVel
end
end
plr.CharacterAdded:Connect(onChar)
if plr.Character then onChar(plr.Character) end
That was ridiculously hard. Just to get that part of it working without a mile of code.
Thanks! It may work for normal jumping, but I would like to find a way to implement a system like that for BodyVelocity. I tried your code with BodyVelocity and it says im free falling when I start jumping, and not at the peak
You can just apply a vertical impulse to the humanoid root part when the player wants to jump:
local function jump(jumpForce: number)
humanoidRootPart:ApplyImpulse(Vector3.yAxis * jumpForce)
end
To know if the player is falling down, you can also check the humanoid root part’s velocity. If the Y component of the velocity is negative, they are falling.
Ya, I fell for this too. … It can’t do the top of the fall thing.
I did find this however and based a script off that, that did work. (re-posted above)
“The player has reached the highest point of their jump when their y velocity passes from positive to negative. This goes for switching any direction, not just jumping.”