How to check for any and all movement from player character?

Before you suggest Humanoid.MoveDirection, that only checks if the player is moving via WASD or arrow keys, I want to be able to check:

  • when the player jumps
  • when the player’s HumanoidRootPart.Velocity changes, since the game I’m making (platformer) makes a lot of changes to that value.

Is there a function that will check universally for any movement of the character? Or do I just need to use Humanoid.Jumping etc to check for both the values listed.

1 Like

You can probably do a RunService and compare the HumanoidRootPart’s position property every time it runs.

I would’ve recommended .GetPropertyChangedSignal, but apparently it doesn’t work for physics-related properties.

Now, I haven’t tested this myself since I’m mainly a .MoveDirection kinda guy.

2 Likes

Seems like GetPropertyChangedSignal really doesn’t like getting any vector3 properties, I’ll attempt to think of another solution.

Alright you may be able to do something like this

What I mean by that is forking the animate script from the roblox character and putting it into startercharacterscripts

Then inside the animate script we’ll find the function move(time) and inside that function check if the pose “standing” if not then the player is moving.

function move(time)
	local amplitude = 1
	local frequency = 1
  	local deltaTime = time - lastTick
  	lastTick = time

	local climbFudge = 0
	local setAngles = false
	
	if not (pose == "Standing" or pose == "PlatformStanding") then
		print("Player is moving")
	end

2 Likes

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