How to detect when a player has reached the highest point of their jump

As the title asks, is there a way to know when the player has reached the highest point in their jump?
Not asking for a full script, but some pointers or some kind of wiki entry detailing so.

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.

A very basic implementation in StarterCharacterScripts

script.Parent:WaitForChild("HumanoidRootPart")
local lastVelocity = 0
while true do
	task.wait(0.1)
	local vel = script.Parent.HumanoidRootPart.AssemblyLinearVelocity.Y
	if lastVelocity >= 0 and vel < 0 then
		print("Highest point")
	end
	lastVelocity = vel
end
2 Likes