How can I make vaulting?

So I want to create a parkour game, one thing needed in those is vaulting, but I dont know how to make it so you can vault over objects so here we are!
So how can I allow a player so when they are close to a ledge and they press space they well vault over it?

Also another thing how can I make a grappling hook?

1 Like

Short Answer: Raycasting

Longer and more in-depth Answer:

A simple way to create vaulting would be to constantly cast a Ray from the HumanoidRootPart and check if the ray has hit an instance.

1 Like

Now for the grappling hook, you honestly have tons of options when it comes to this.

Rope Constraints: RopeConstraint | Documentation - Roblox Creator Hub

Mouse: Mouse | Documentation - Roblox Creator Hub

LinearVelocity: LinearVelocity | Documentation - Roblox Creator Hub

BodyVelocity (Deprecated): BodyVelocity | Documentation - Roblox Creator Hub

Ok well yes but once the ray hits something and there is an instance, than what? I need to know if they can vault over it

You could probably turn off collision on the players legs or body then use the velocity to move them forward.

If you mean how to check if you’re able to vault over the object then you could use Tags

1 Like

Ok so uh yeah no. Lets say I tag a big object right, I want it so you can only vault if you are near the top of it, but If I just tag it then you can vault over it from the bottom(if its 100 studs big that’d look pretty weird).

So same question, how to make vaulting?

Whenever the player jumps while sprinting/running, you should fire multiple raycasts in front of the player to determine if they jump or vault over an object. I would fire a good 15 raycasts to make sure we aren’t missing any gaps.

Now, if only the lower raycasts hit something but not the upper ones, the player should vault over the obstacle. However, if both high and low raycasts hit something, the player is probably in front of a wall, so they shouldn’t vault over it.

1 Like

Just wanted your thoughts, but do you think I should handle most of this client-sided. I dont think it would really matter considering if someone was exploiting they could just fly over it or whatever

Yeah, you should make it client-sided.

Well, you’d have to make your own detection system then, or you could add parts to the top of every vaultable object, which i wouldn’t recommend.

Cast a ray from the HumanoidRootPart to its front with distance around 2-5 studs.
If it hits then cast a ray from the Head, the same front 2-5 studs.
If the head ray doesn’t hit then vault them.

Pretty simple.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.