Hiiii! I’m making a game and really want to add a vaulting thing where the player can jump out windows and stuff but I literally don’t know hoooow! I’ve tried tutorials and using the ai in the studio and I just can’t get it to work if find anyone that can teach me how to do it. Can someone PLEASE help! I just need to learn how to make the player literally vault over a block with an animation I will create and that’s it! Any help will be REALLY appreciated 😇
#Vaulting system
1 messages · Page 1 of 1 (latest)
How much do you know when it comes to Lua
Learn animations first, then trigger the animation and play it when the player touches the vaulting part.
** You are now Level 1! **
You can manipulate the player position and camera effects to make it more dynamic.
I mean I’d say I understand the basics but not enough to do elaborate scripts like that 💔
Okay PERF I got that set now ty! It didn’t work earlier I don’t know why, but how do I make it so that the player actually goes across the “wall”? Bcs when I click the proximity button and the animation plays, since the wall is set to collidable, the player doesn’t go across and just kind of like gets pushed back. And I can’t set it to non collidable because that kind of defeats the whole purpose of it
And this isn’t as important I’m sure I can figure it out but do u or anyone else know how I can make it so that when the player clicks the proximity prompt it like freezes them and puts them in front of the wall so the anim actually works?
** You are now Level 1! **
in the start of the anim you can set the players position to the walls position, with an offset to it (like its CFrame.LookVector)
im guessing u can anchor the humanoidRootPart but that wont get the player infront of the wall
maybe spam set its cframe to that of the torsp
OMG YESSSS IT TOTALLY WORKED! TYSM!
And by any chance do u know how to fix this problem?
It’s like the last thing I need to finish this whole thing I think
Wait actually there’s something else
Does anyone know how I can make it so that the player can vault both inside and outside? Because with this (which is totally amazing) now it always sends the player to one side of the wall
Like this is the situation
detect which side the player is in
like if u add a while to the lookvector, will the player turn out in this area?
if not, then its the opposite side
OMG U HELPED ME DISCOVER IT THX!
I added a thing called dot I think and then that sees where the player is facing and depending on the side it vaulted the other way!
Ty I appreciate it!
Now I’m almost sure THIS is the last thing I need
If anyone knows how to make it so that the character actually goes to the other side and doesn’t go back to the original spot please tell me!
sure
can u show me the animation?
not the completed thing
in the editor
or ill just tell you
Wdym?
** You are now Level 2! **
right when the animation ends; add an animation event. if your using the builtin animation editor, make sure to set both fields to a name
the same name
then, atfer the anim:Play() insert
anim:GetMarkerReachedSignal("AnimEnd"):Connect(function() -- replace "animend" with the animation event name
character.HumanoidRootPart.Position = character.Torso.Position -- ofcourse you need to replace 'character' with the player character's path
end)```
I don’t know if I’m doing it right because it’s not working 😔😔
This is the script I have
local ProximityPrompt = script.Parent
local wall = script.Parent.Parent
local AnimationId = "rbxassetid://myanimation" -- Vault animation with event
ProximityPrompt.Triggered:Connect(function(player)
if not player or not player.Character then
return
end
-- 🕒 Temporarily disable prompt
ProximityPrompt.Enabled = false
task.delay(3, function()
ProximityPrompt.Enabled = true
end)
local character = player.Character
local humanoid = character:FindFirstChildOfClass("Humanoid")
local hrp = character:FindFirstChild("HumanoidRootPart")
if not humanoid or not hrp then
return
end
-- Freeze the player
humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
-- 🧠 Calculate vault direction BEFORE rotating player
local wallLook = wall.CFrame.LookVector
local directionToPlayer = (hrp.Position - wall.Position).Unit
local dot = wallLook:Dot(directionToPlayer)
local directionMultiplier = dot > 0 and 1 or -1
local vaultDirection = wallLook * directionMultiplier
-- Move player in front of the wall based on side
local distanceFromWall = 2
local vaultPosition = wall.Position + vaultDirection * distanceFromWall
local lookAtWall = CFrame.new(vaultPosition, wall.Position)
hrp.CFrame = lookAtWall
task.wait(0.1)
-- Create and load animation
local animation = Instance.new("Animation")
animation.AnimationId = AnimationId
local animator = humanoid:FindFirstChildOfClass("Animator")
local track
if animator then
track = animator:LoadAnimation(animation)
else
track = humanoid:LoadAnimation(animation)
end
if track then
track:Play()
-- 🔁 Move player when animation event "VaultOver" is reached
track:GetMarkerReachedSignal("VaultOver"):Connect(function()
local vaultDistance = 4 -- Adjust if needed
hrp.CFrame = hrp.CFrame + vaultDirection * vaultDistance
end)
end
-- Unfreeze after animation ends
task.delay(3, function()
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
end)
end)
I’ve been trying to tweak it for like an HOUR and everything works except the part where it’s supposed to take the player to the other side
😭😭
-- 🔁 Move player when animation event "VaultOver" is reached
track:GetMarkerReachedSignal("VaultOver"):Connect(function()
local vaultDistance = 4 -- Adjust if needed
hrp.CFrame = hrp.CFrame + vaultDirection * vaultDistance
end)
end
I think this is the part that’s wrong but can someone tell me how I can fix it please!!
But I did do this I’m sure of it so that’s crossed out as the problem
OMG im so sorry for the really late reply
** You are now Level 7! **
i was asleep 😭
also can y'all PLEASE type your code like this
```lua
(code here)
```
ITS SO HARD TO READ >:(
did you try subtracting it instead?
hrp.CFrame = hrp.CFrame - vaultDirection * vaultDistance
i can see the character moves backwards in both cases
so just subtract instead of adding it
wake up
OKAY IM SORRY!!!😔
Oooo let me try
Yeah I was asleep too soooorry
Okay well I don’t know if that worked bcs like I said in my other post, the character like slooowly stops working and I suspect it’s something other than the script and it’s so annoying 😔
Actually maybe that doesn’t work because now I can only vault on one side…
?
another post?
you changed it to
hrp.CFrame = hrp.CFrame - vaultDirection * vaultDistance
???
maybe add parentheses
hrp.CFrame = hrp.CFrame - (vaultDirection * vaultDistance)
Yupppp
** You are now Level 3! **
Hmmm okay let me try
Oh my GOD it still doesn’t work 😞
It only made the vaulting stop working faster
Sameeee, I literally can’t figure out what’s wrong
TEARDROP SOMEONE JUST TOLD ME HOW TO FIX IT BUT THANK YOU SOSO MUCH FOR EVERYTHING I GENUINELY COULDNT HAVE GOTTEN THIS FAR WITHOUT U 🫶🫶🫶
?
wheres ur other post
send a link