Player velocity with magnitude and getpropertychangedsignal

sounds weird but what i mean is

player.MovingDirection.Magnitude

or however you did it but with GetPropertyChangedSignal()

Can you please be more specific. I’m really confused what your trying to ask.

telling the magnitude of the player with getpropertychangedsignal so you can tell when it changes

1 Like
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()

local Humanoid = Character:WaitForChild("Humanoid")

Humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
	print(Humanoid.MoveDirection.Magnitude)
end)
1 Like

image

It’s MoveDirection not MovingDirection.

If this is a server script, it will not work. Turn it into a local script or change the RunContext of it to Client.

1 Like

i am a failure LOL thanks lemme test.

DAMNIT any other way to do it on the server? i really REALLY need it.

Let me see if I can make it server-sided.

1 Like
game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		local Humanoid = Character:WaitForChild("Humanoid")
		
		Humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
			print(Humanoid.MoveDirection.Magnitude)
		end)
	end)
end)
1 Like

ohhhhh I thought you meant that magnitude wouldn’t work. i have a for loop.

1 Like

ok uhhhh
image

Show me the code, shouldn’t be happening.

nevermind i am stupid i saw what you sent lemme fix it

just prints 0 and 1… is that normal? i am trying to tell since i want to tell the difference between an older magnitude and the new one.

It is a normal response, if you want to record the differences add the responses to a table and get the difference.

well how would i get the player’s velocity?

heres how you get it in a script:

local velocity = chr.PrimaryPart.AssemblyLinearVelocity
1 Like

Or, just for clarity,

local playerVelocity = character.HumanoidRootPart.AssemblyLinearVelocity