I am trying to emulate the climbing system from a VRChat world called “EvolvedAnt Arcade” - specifically the one used for non-vr players. Playing this world will greatly help you understand my issue, but in a nutshell, you can click on a point in the world and your character will pivot around the point, allowing you to throw yourself around by latching on and off of walls.
I’ve tried a few things to achieve this, but none work because I am not sure how to generate physical momentum. What I mean by this is that while I can pivot the character around a point using cframes, as soon as the player releases from the wall they just slam into the ground since no real physical movement is being done as far as the physics engine is aware.
If anyone has a good idea on how to recreate the mechanic or fix my current implementation, that would be great.
In case it helps, here is what I currently have:
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Mouse = Player:GetMouse()
local Cam = workspace.CurrentCamera
local mousedown = false
local Params = RaycastParams.new()
Params.FilterType = Enum.RaycastFilterType.Include
Params.FilterDescendantsInstances = {workspace.Grabbable}
Mouse.Button1Down:Connect(function()
local ray = workspace:Raycast(Cam.CFrame.Position, Cam.CFrame.LookVector*10, Params)
if ray then
mousedown = true
local marker = Instance.new("Part", workspace.GrabPoints)
marker.Size = Vector3.new(1, 1, 1)
marker.CanCollide = false
marker.Color = Color3.new(1, 0, 0)
marker.Anchored = true
marker.Position = ray.Position
while mousedown == true do
marker.CFrame = CFrame.new(marker.CFrame.Position)*Cam.CFrame.Rotation
Player.Character.HumanoidRootPart.CFrame = marker.CFrame*CFrame.new(0, -1.5, 10)
task.wait()
end
end
end)
Mouse.Button1Up:Connect(function()
mousedown = false
for _, v in pairs(workspace.GrabPoints:GetChildren()) do
v:Destroy()
end
end)
Feel free to run it yourself and see if you can come up with any fixes, but I feel like a full rewrite is in order.