Rolling while jumping allows players to go further than they should. How can I fix this?

Title basically explains the issue.

I have a rolling script and whenever a player rolls it places a body velocity inside of their humanoidrootpart.
If they jump however whilst rolling they go much farther than intended. How can I fix this? I’ve tried ending the roll if it detects humanoid state freefall or if hum.FloorMaterial == air

3 Likes

Couldn’t you get the Humanoid Property Jumping (Humanoid | Roblox Creator Documentation)?

1 Like

Just use Humanoid:GetPropertyChangedSignal(“Jumping”):Connect(function()) mabye. (Instance | Roblox Creator Documentation)

1 Like

Set their JumpPower to 0 while they have the BodyVelocity.
Humanoid.JumpPower = 0.

3 Likes

they can still jump prior to the roll.

I will try this out and let u know how it goes

Can u show us a video about the behavior

Do it before they roll it then?

He already explained it in words, I don’t think you need one.

how would he do it before. he can’t just know in the past before they are about to press it :man_facepalming:

He would definitely know before they roll.
He could simply set their JumpPower before giving them the BodyVelocity.

Have you tried setting the max force on the y axis to 0 so you won’t float even if your on the air.

BodyVelocity.MaxForce = Vector3.new(1,0,1)*10^6
1 Like

if they jump before they do it they are still in the air bud.

it is already set to 0 they still go midair when they jump obviously.

In this case, most of the time probably.
At that point, I would just anchor their PrimaryPart unless OP wants something else.

Well why don’t you just disable the roll ability when they are jumping and enable it again when they aren’t jumping? You could also lower the speed when they are jumping and increase it again when they aren’t jumping.

2 Likes

https://gyazo.com/0f9b5586c54170464d401dd77488e963

This did not work for me after trying :frowning: .

also
@rottendogDkR I still want players to be able to roll midair. I just don’t want it to be faster

I think the reason that it is slower when not jumping prob due to friction

Also from the looks of it, when rolling on a floor you will intentionally have less speed due to friction and when in air your speed will increase so try changing the speed or make the max force and power of the body velocity higher