Climbing system - help!

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.

2 Likes

so, for making the player perpendicular to the wall, you’ll want to multiply the cframe by the ray.normal*CFrame.FromOrientation(0,math.rad(180),0), if that is your problem.

Heya, thanks for the tip but this isn’t what my issue is. I want to apply physical momentum to “throw” the player with a force based on how they moved when attached to the pivot point. If you play both my script and the VRChat world you will probably be able to get a better idea of what I mean by this - far better than I can put into words.