Accurate way to detect if user is always moving?

I know about move direction, but the thing is if the player just moves in a straight line, move direction wont update, i need to know when the user is moving ALWAYS.

why not just check if MoveDirection.Magnitude ~= 0 in a loop

2 Likes

I hope this helps.

local players = game:GetService("Players")

local LocalPlayer = players.LocalPlayer

if not LocalPlayer then 
	players:GetPropertyChangedSignal("LocalPlayer"):Wait()
	LocalPlayer = players.LocalPlayer
end

local character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local Humanoid:Humanoid = character:WaitForChild("Humanoid")
local Moving = false

Humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
	
	
	if Humanoid.MoveDirection.Magnitude == 0 then
		Moving = false
	elseif Humanoid.MoveDirection.Magnitude > 0 then
		Moving = true
	end
	
	print(Moving)
		
end)

Wow, didnt think of that, thank you!

Shoot, i forgot about something… The movedirection events fires each time it changes… it wont solve the problem, if the user runs in a straight line movedirection wont fire and it wont update

so you want the player to keep moving in different directions at all times or how

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.