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.
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.
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
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
im not 100% sure tho it might also just be raycasting from the legs and the head
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
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.