Help with detecting Character Position

Hello! In my game that I am currently making I want to detect when a character falling down (Being affected by a body velocity downwards) reaches the ground. I have currently tried Raycasting which does work but not as well as I would have hoped. Since there is a delay between the server and the client this means that detecting when the character hits the ground is delayed. Is there any solution to this that would minimize the delay between hitting the ground and my script reacting to it?

1 Like

Have you seen Enum.HumanoidStateType.Landed?

There’s a few ways I can think of in order to achieve this.

  1. Humanoids have a “state” enum that describes what they’re currently doing. They also have an event that fires when this state changes. By listening to this event, you can check if the player is falling or not. You can find the list here.
  2. Humanoids have a “FloorMaterial” property that describe the material of the floor they’re on. I suppose they return nil when not standing on a floor
  3. Humanoids have a MoveDirection property that returns a unit vector which is basically the direction. I assume you could check if the Y vector of it is negative, which would tell you it’s moving down.