Velocity is deprecated?

I want to animate a npc when it moves, but the script says that velocity is deprecated.

Here is the script:

local Hum = script.Parent.Humanoid
local Swim = script.Swim
local SwimPlay = Hum:LoadAnimation(Swim)

Hum.Running:Connect(function()
	if script.Parent.HumanoidRootPart.Velocity.Magnitude > 0 then
		SwimPlay:Play()
	else
		if SwimPlay:Play() then
			SwimPlay:Stop()
		end
	end
end)

How do I find the speed of it now?

Use AssemblyLinearVelocity instead; it’s the exact same thing.

1 Like

Oh! Ok, I thought it was something different.:rofl: Thank You!