I am trying to make a hockey game and I would like snow to fly out when a player rapidly changes directions, however, I do not know how to tell if a person is going at 16 speed to 0. Thank you to anyone who can help! I hope this was enough information.
Use runservice and check the change in walk speed on each frame?
Wouldn’t this cause lag because the server would be checking each player every frame?
Runservice is well-optimized especially when only checking values. I’m not sure if GetPropertyChangedSignal works on Humanoid properties, but you can try using it. You could also listen for when the Humanoid’s Move Direction changes. There should be something for you on the Humanoid page.
Humanoid | Documentation - Roblox Creator Hub
If you’re doing simple arithmetic (16 - 40) I can almost guarantee you this is negligible performance wise.
Though checking when the property changes like @Bovious suggested is a better idea. I forgot about that.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.