How would I make a vault system?

How would I make a vault system like Untitled Tag Game?

External Media
2 Likes

Based on the video

Heres what id do
  1. Raycast

Have the Character detect if they can vault/lunge over an object by shooting maybe a raycast and detecting the height of the part

  1. Height Conditional

I’ll determine if the object can be vaulted over when I have the height.

  1. Animation

Then id make an animation track, which i’d then put Animation event marks
when the animation marks are triggered, i’d put velocity to be added on in a function using body movers

	LeapAnimationTrack:GetMarkerReachedSignal("Leap_Start"):Connect(function()
		Character_Agility.Dash(50,30)	 
	end)

Animation Events | Documentation - Roblox Creator Hub usage
4. BodyMovers

for the lung effect you gotta add some :person_shrugging:

that’s pretty much it :man_shrugging:

1 Like

Hey, i made a vaulting system NOT EXTREMELY ACCURATE! but still works, since untitled tag recode has a DEBUG system, i MIGHT have figured it out how it worked, and here it is

local humrootpart = script.Parent:WaitForChild("HumanoidRootPart")
local char = script.Parent
local invis = false -- make it invisible if you want so
local dist = 1.25

local folder = workspace:FindFirstChild("VaultFolder") or Instance.new("Folder")
folder.Parent = workspace
folder.Name = "VaultFolder"

function vel()
	wait(.75)
	script.Parent.Humanoid.JumpPower = 50
end

function climb()

	local vault = game.ReplicatedStorage:FindFirstChild("Stuff") and game.ReplicatedStorage.Stuff:FindFirstChild("Vault") or Instance.new("Part")
	vault.Name = "Vault"
	vault.Size = Vector3.new(0.1, 2, 0.1) -- You have to code urself a new size if above 0.1 X Z
	vault.Anchored = true
	vault.CanCollide = false
	vault.Color = Color3.fromRGB(36, 165, 0)
	if invis then
		vault.Transparency = 1
	end

	local part = vault:Clone()
	part.Parent = folder
	part.Touched:Connect(function() end)
	part.Position = humrootpart.Position
	part.Position += humrootpart.CFrame.LookVector * dist
	game.Debris:AddItem(part, 2)

	local rayOrigin = part.Position + Vector3.new(0, part.Size.Y - (part.Size.Y/2), 0)

	local d = Instance.new("Part")
	d.Parent = folder
	d.Anchored = true
	d.Size = Vector3.new(.2,.2,.2)
	d.Position = rayOrigin
	d.Transparency = 0.5
	d.Anchored = true
	d.CanCollide = false
	d.Name = "Checking"
	if invis then
		d.Transparency = 1
	end
	game.Debris:AddItem(d,2)

	local dir = Vector3.new(0, -part.Size.Y - (part.Size.Y/2), 0)
	local ignored = {char, part, d, folder}

	local params = RaycastParams.new()
	params.FilterDescendantsInstances = ignored
	params.FilterType = Enum.RaycastFilterType.Exclude

	local result = workspace:Raycast(rayOrigin,dir,params)

	local hit = nil

	for i,v in pairs(part:GetTouchingParts()) do
		if v:IsA("BasePart") and not v:IsDescendantOf(char) and not v:IsDescendantOf(folder) then
			if result and v then
				local hitpt = result.Instance
				if not invis then
					--print(hitpt,v)
				end
				if hitpt == v then
					script.Parent.Humanoid.JumpPower = 70
					script.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
					print(hitpt,v)
					--	vel()
					break
				end
			end
		end
	end
	task.delay(.001,function()
		script.Parent.Humanoid.JumpPower = 50
	end)
end

local cooldown = false
game.UserInputService.JumpRequest:Connect(function()
	if script.Parent:FindFirstChild("Humanoid") then
		if cooldown == false then
			cooldown = true
     	    script.Parent.Humanoid.JumpPower = 0
			climb()
			task.wait(.3)
			cooldown = false
			-- Jump request has 3 requests if you are running smoothly
		end
	end
end)

You can change if you want to see the sizes and the debug by setting (obviously) the invis to on, and can change your dist to whatever u want

(this is a localscript placed into startercharacterscripts)

2 Likes

You can also add the animation as how @Exetrenious said:

And by the way the dash/velocity system isnt one of the bests, couldnt find a way to use it without making the player slower :frowning_face:

3 Likes