Help with orientating with raycasts

Alright this title doesn’t exactly make sense, but I’m attempting to make a RDR2 type game, and this also means Euphoria ragdoll.

So I’ve got the base premise of the ragdoll sorted out, every frame I’m sending a raycast down to check if your high enough, if your fast enough trip. But the problem I have is the player falls to late, and this is because I purposely do this so you can jump to other platforms here is what I mean

But if I trigger at the point I want to trigger he may not be able to reach the platform he is most likely jumping to.
So what I was thinking was sending raycasts, instead of straight down, to the velocity he is travelling,
like this.

The only reason I created this post is because I want to know how I could actually angle the raycast in this fashion. Any response is highly appreciated because this has been a long ongoing problem for me

use Humanoid.MoveDirection and then you can shoot the ray by doing HRP.Position + (MoveDirection*15)
tell me if this doesn’t work

would this not cause issues if the player is not forcing movement?
Like if the player is forced into that direction would it then not work?

uh, use velocity i guess? (HRP.Velocity)
that would work as in terms of finding a direction i would assume…

wow, I must be stupid or something, I forgot velocity returns vector3. Thank you so much

BasePart Velocity is deprecated. You can emulate it with BasePart:GetVelocityAtPosition(BasePart.Position) or use AssemblyVelocity.

OP, I’m not very familiar with RDR2 or “euphoria ragdoll”. Is there some reason you can’t use HumanoidStateType instead of some constantly iterating loop raycast?

well, its basically ragdoll but its almost alive,
so the reason Im constantly using raycasts is, if the player is already ragdolled and he is pushed off a cliff I need him to react, but the HumanoidStateType doesn’t change.

an example

The humanoid sees this,

No differently than it sees this.

to the humanoid it sees both as PlatformStand

1 Like

Do you mean the lag on ragdoll?
if is the laggy on ragdoll
Just make a script thats disable rootjoint and when unragdolled root join enabled

(also sorry for too late reply)

No I just meant I wanted the raycasts rotate the face the velocity of it