Hey, how do I get a single-number player velocity? I just need to know how fast the player’s moving, but not the walking speed. Because the player needs to accelerate before moving at max speed. I want to make it so that the player can only jump really high when moving really fast and not just idle or walking.
1 Like
One way involves taking the magnitude of HumanoidRootPart.AssemblyLinearVelocity
. Also possible to exclude the Y-value and only read plain movement velocity.
Example in a local script (excluded vertical factor):
local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
while true do
task.wait(.2)
print(
(hrp.AssemblyLinearVelocity * Vector3.new(1,0,1)).Magnitude
)
end
But how do I detect if that’s the max speed the player can go? Can you determine it using the walk speed?