local Players = game:GetService("Players")
local rp = game.ReplicatedStorage
local summon = rp:WaitForChild("Summon")
local Ismoving = true
print("1")
summon.OnServerEvent:Connect(function(Player, isActive)
print("2")
local character = Player.Character
local Stand = character:WaitForChild("Stand")
local AnimControl = Stand:FindFirstChild("AnimControl")
local humanoid = character:WaitForChild("Humanoid")
print("4")
local Idle = AnimControl:LoadAnimation(script.Parent.Idle)
local MovingAnim = AnimControl:LoadAnimation(script.Parent.MovingAnim)
local Stand = character:WaitForChild("Stand")
if humanoid.MoveDirection.Magnitude > 0 then
Ismoving = true
else
Ismoving = false
end
wait(0.1)
if Ismoving == true then
MovingAnim:Play()
print("5")
else
Idle:Play()
print("5")
end
end)
print("Done")
How do I always check the magnitude without putting it in a loop

4 comments
it detects the slightest change and resets the animation but what I want it to do is just check if the player is moving or not ( because when it detects a change in the magnitude it resets the animation )
ya mean this?
direction is not a valid member of vector 3
pardon cat i meant .Magnitude not .Direction ;w: