How to detect a character falling and landing

I’m trying to detect when a character starts and stops falling so that I can check how far they fell and ragdoll them if I need to.

I was able to get it working, but there was a small delay because I did it on the server to prevent it from being exploited.

I have tried detecting humanoid state changes, detecting velocity changes, and raycasting, but all of these have had a delay when done from the server.

I saw someone on the forum saying that there’s no point in doing it server-side because they can stop it from detecting that their character is falling anyway. Is this true? Please reply with any advice. Thank you!

Have you tried detecting the animation of the player? Perhaps if you can detect the sudden change between the falling animation and then a different animation?

Also I believe this is one for the Scripting Support category. Game design is more to do with logic, quality assurance, game styles or plans.

I haven’t tried this, but even if it did work, animations are controlled by the client, which means it would be exploitable and I might as well just detect state changes on the client.

I changed it. I don’t know why I put it in game design. :joy:

1 Like

I see, forgive that I’m not too knowledgeable in scripting.
What about HumanoidDescription > FallAnimation ?

I would check this article out:
https://developer.roblox.com/en-us/api-reference/event/Humanoid/StateChanged

You can detect changes in the state of the humanoid, including Landing, Jumping, and Falling :slight_smile:

Sorry for the late reply. I have tried this already, but it was delayed.

Ah of course, any checks verified on the server will always have some sort of delay to it. It’s pretty much inevitable.

This is completely true, by the way. The clients can change their states and trigger a ragdoll state. There are ways you can handle this situation.

  1. Handle the checks on the client and ensure that false ragdoll states won’t affect the main gameplay. This can be done using server checks that are contextual to your game.
  2. Accept that there is inevitable delay in server sanity checks and verify from the server to prevent exploitation of the ragdoll state.

I would personally choose option 1, since option 2 may hinder valuable gameplay!

If anyone has any ideas to add on, please let me know :slight_smile:

2 Likes