How to make a vaulting system resembling untitled tag game?

Hello. I am making a parkour game and I am wondering how to make a vaulting system kind of like untitled tag game.

(I just want something similar, and every other thing like this I found doesn’t work in my context.

5 Likes

just a assumption

Raycast infront of the player, see which wall they want to vault, check magnitude which id presume would be around 3 and then if its below 3 let them vault it, else dont

3 Likes

im not to sure lol it might have something to do with
humanoid:Getstate()

and checking if its climbing i have 2 reasons for this

  1. normally when walking on a sphere like that your character starts to climb
  2. this vaulting also works when climbing on ladders and ladders obv make you climb

im not 100% sure tho it might also just be raycasting from the legs and the head

2 Likes

I’m working on a parkour system right now, and I have created something similar to this.

Pretty much what I did is that I detected on the client when your humanoidrootpart is touching something (a wall), and you click space, your humanoidstatetype gets set to Jumping. I added a cooldown. This obviously is a very inefficient method, but if you want to try it, go ahead

1 Like

I figured it out.

local ledgeVaulting = false

local spacething = false

local hrp = game.Players.LocalPlayer.Character:WaitForChild("Torso")

local head = game.Players.LocalPlayer.Character:WaitForChild("Head")

local hum = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")

local vaultAnim = hum:LoadAnimation(script.ledgeVaultAnim)

local Character = game.Players.LocalPlayer.Character

local parms = RaycastParams.new()

local uis = game:GetService("UserInputService")

parms.FilterDescendantsInstances = {Character}

uis.InputBegan:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.Space then

		spacething = true

		print("started key")

	end
end)

uis.InputEnded:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.Space then

		spacething = false

		print("ended key")

	end
end)

game["Run Service"].RenderStepped:Connect(function()
	if spacething and not ledgeVaulting then
		local dir = hrp.CFrame.LookVector * 4

		local dir2 = head.CFrame.LookVector * 4

		local hrpRaycast = game.Workspace:Raycast(hrp.Position, dir, parms)

		local headRaycast = game.Workspace:Raycast(head.Position, dir2, parms)

		--print("raycasted")

		if hrpRaycast and not headRaycast then
			ledgeVaulting = true

			print("smth")
			
			--local vel = Instance.new("BodyVelocity")
			
			--vel.Velocity = Vector3.new(hrp.CFrame.LookVector.X * 4,50,hrp.CFrame.LookVector.Z  * 4)
			
			vaultAnim:Play()

			script["Bicycle Drop 2 (SFX)"]:Play()
			
			for i = 1,4,1 do
				task.wait(0.1)
				hum:ChangeState(Enum.HumanoidStateType.Jumping)
			end
			
			--game.Debris:AddItem(vel, 0.05)
			
			--vel.Parent = hrp
			
			
			
			task.wait(0.25)
			
			
			
			ledgeVaulting = false

			

		end

		if headRaycast then
			print("ok")
		end

		if hrpRaycast then print ("why") end
	end
	
end)


It only works on ledges (I think), you have to add the sounds and animations however, or it will result in a nil error.

1 Like

Works perfectly! Thank you so much! I forgot about this post and gave up on the project, but I think this will help in the future!

1 Like

No problem, I’m also using this method in my game. Thanks for the solution!

1 Like

The UTG vault system works like this:
It spawns a raycast from the head offset by the humanoid root parts look vector aiming straight down until it reaches half the characters body.
If it hits something, it checks if the normal is facing downwards.
If it isn’t, it takes the height difference between the result’s position and the player. This number is then multiplied by a growth factor and added onto a separate static vault strength. Then, you apply an upwards force to the player with that combined boost strength. This lets you have a minimum vault height and high vaults by vaulting a bit lower from the edge.
To increase the speed, there is a separate force applied in the direction the player wants to go, think WASD. You get a WASD unit vector from the players humanoid.
The air movement in UTG has deccel and accel so it’s a bit harder to move, but with the boost sending you directly in the direction you want to go, it lets you turn a bit easier as well.

UTG doesn’t disable collisions when vaulting because the sense of speed is low and its hard to tell when your running into a wall compared to running in an open field. If your going to add speed lines or FOV changes, you need to disable the players collisions for around 0.25 seconds. If you do this you have to figure out how to prevent the player from entering the jump state for around 0.3 seconds so the don’t vault and the jump directly after the jump, sending them into the stratosphere.
Also prevent the humanoid from entering the jump state when the raycast touches something. For the same reason.
@eljefeistheboss’s implementation creates 2 raycasts facing forwards every renderstepped, but you only need to create 1 facing down when you press space.

1 Like

I was going for more of a vaulting system, but decided to reply to this thread because it works similarly too.

1 Like