Hello, I was wondering how I could possibly make a jump look like the blue line. I don’t specifically need to add it when the player jumps, since I’m hesitating between making it a move or the default jump.
Do I use BodyPositions? If so, how? I’ve never used them.
(Blue line pointing out a kind of ‘bhop’/strafe type of jump, the red line pointing out the normal roblox kind of jump.)
3 Likes
So every time you jump, you’d move forward?
Set Roblox’s default JumpPower to 0, and then use ContextActionService to bind the Spacebar/ButtonA/etc. to the function for jumping forward.
Would look something like this:
local function BHop(ActionName, InputState, Input)
if ActionName == "BHop" then
if InputState == Enum.UserInputState.Begin then
Character.HumanoidRootPart.Velocity = Character.HumanoidRootPart.CFrame.LookVector * 30 + Vector3.new(0, 10, 0)
end
end
end
game:GetService"ContextActionService":BindAction("BHop", BHop, false, Enum.KeyCode.Space)
-- In the above line, the first arg is the action name, the 2nd arg is the function, the 3rd is a bool on whether to create a
-- mobile button for the action, and the next howver many args you want are all Input KeyCodes/Types you want for the action to run
4 Likes
Thank you! I’ve upgraded it and I’ll now look for a way to make it work with strafing, so that it’s a lot better.
I know this is kind of a late post, but I’ve been meaning to try and make my own bhopping mechanic and the script RogueMage provided is not working properly. I wanted to ask what your upgraded script looked like, or if you faced a similar issue.
My issue with his script was that the velocity would be registered but the HRP would still be “grounded” (i.e. it wouldn’t actually move to the desired spot, but only jank itself a bit)
2 Likes
It’s alright, no worries.
Since I can’t directly give you my script, I will give you what I based my script off of.
–
This is a very old, messy but working client bhop handler, that was originally made/imported by @pdnghiaqoi. It is however very helpful if you’re trying to understand how to make Roblox strafing physics/mechanisms.
1 Like
I’ll take a look at it. Thank you!
1 Like
This is a 1 month old thread I know, but I notice that the script you mentioned doesn’t respect non collide-able objects, it just simply goes to the top of the non collide-able object, is there a way to avoid this?
I actually haven’t noticed that. The way this detects parts is with raycasts, so I guess you’d have to implement a check to see if collision is off then you’d ignore the part.
1 Like