Default magnitude of a player

Hello! I’m looking for a specific magnitude of a player when walking
at 15 or higher Walk speed. Does anyone know?

if hum.MoveDirection.Magnitude > 0 then
				
end
2 Likes

by that what do you mean? are you trying to get its speed?

1 Like

for speed do this

local speed = HumanoidRootPart.Velocity.Magnitude
1 Like

Yes, I am trying to make a camera bobble during High Speeds

1 Like
local speed = HumanoidRootPart.Velocity.Magnitude
if speed > 16 --[[16 is average speed]] then
-- do stuf
end
1 Like

Alright, I will try this one

char limit

Would this work, or for only running?

char.Humanoid.Running:connect(function(speed)
		running = speed > 18
end)

game:GetService("RunService").RenderStepped:connect(function()
	local dt = tick()-lastTick
		if running then
		t = t+dt
			local look = cam.CoordinateFrame.lookVector
			cam.CoordinateFrame = CFrame.new(cam.CoordinateFrame.p, cam.CoordinateFrame.p+look) * CFrame.Angles(0, 0, math.rad(math.cos(t*11)))
		end
		lastTick = tick()
end)
1 Like

that works for everything if your in a car, falling down, jumps, walk, run and many more!

2 Likes

It would probably be better to use game.StarterPlayer.CharacterWalkSpeed instead of some hard coded value so you could change the default player walkspeed in the future without needing to worry about this script.

2 Likes