Issue with VR climbing system

I’m trying to make VR climbing similar to Edgeworks or Boneworks and I’ve done it before but this time my code refuses to work.

Here is my code if anyone can help and also a video

local Part = Instance.new("Part", Item)

			Part.Name = "GrabPart"

			Part.Anchored = false
			Part.Transparency = 0
			Part.CanCollide = false
			
			Part.Color = Color3.fromRGB()
			
			Part.Position = HitPos
			
			local Attachment = Instance.new("Attachment", Part)
			
			local Weld = Instance.new("WeldConstraint", Hand)
			
			Weld.Name = "Weld"..Hand.Name
			
			Weld.Part0 = Hand
			Weld.Part1 = Item
			
			local AlignPos = Instance.new("AlignPosition", Hand)
			
			local AlignPos2 = Instance.new("AlignPosition", Part)
			
			local Attach1 = Instance.new("Attachment", Part)
			local Attach2 = Instance.new("Attachment", Hand)
			
			AlignPos2.Name = "AlignPos2"..Hand.Name
			
			AlignPos2.Responsiveness = 10
			
			AlignPos2.Attachment0 = Attach1
			AlignPos2.Attachment1 = Attach2
			
			AlignPos.Name = "AlignPos"..Hand.Name
			
			AlignPos.Attachment1 = Part.Attachment
			AlignPos.Attachment0 = Player.Character.Legs.Attachment
			
			AlignPos.Responsiveness = 20
			--AlignPos.MaxForce = 10000
			AlignPos.ReactionForceEnabled = true
			
			Run = game:GetService("RunService").Heartbeat:Connect(function()
				if Part ~= nil then
					if Hand.Name == "LeftHandCollide" then
						--Part.CFrame = CFrame.new(HitPos + Player.Character.LeftHand.Position)
						--Part.CFrame = CFrame.new(Player.Character.LeftHand.Position.X * -1, Player.Character.LeftHand.Position.Y * -1, Player.Character.LeftHand.Position.Z * -1) + Hand.Position
						Part.CFrame = CFrame.new(RealLeftCFrame.Position.X * -1, RealLeftCFrame.Position.Y * -1, RealLeftCFrame.Position.Z * -1) + Hand.Position
						task.wait()
						
					elseif Hand.Name == "RightHandCollide" then
						Part.CFrame = CFrame.new(RealRightCFrame.Position.X * -1, RealRightCFrame.Position.Y * -1, RealRightCFrame.Position.Z * -1) + Hand.Position
						task.wait()
					end
				end
			end)

See how the locomotion ball in charge of the players position just goes straight to the part? i need it to go near the part

4 Likes

Essentially, what you’ll want to do is rather than setting the CFrame of the hands, you’ll want to use align forces to position and orient the hands.

You can use the reactionforce property to allow for climbing, and just by welding the hands, your problem is fixed!

1 Like

Could you explain a little bit more on how to use Align Position for VR Climbing? Because I am trying to make a climbing system

1 Like

Connect align positions to your hands with attachments located in your “root part” (can move, don’t rotate! it’ll offset your hands alignment). CFrame the attachments on RenderStepped and make sure reactionforce is enabled.

2 Likes

Ah I see, thank you! But I have one question, what do you mean by CFrame the attachments?

1 Like

Set their WorldCFrame to the reported hand CFrame

1 Like

Ok so I have set up everything but when I go to push myself off a wall I end up getting pulled into the wall.

1 Like

then you have it backwards haha

1 Like

Oh Whoops, Here’s what I had set up. I had one Align Position parented to the Physics Hands with ReactionForceEnabled with Attachment0 being the Physics Hand’s Attachment and Attachment1 being the “True” Hand’s CFrame. Then I had one more Align Position Parented to the HumanoidRootPart with ReactionForceEnabled and having Attachment0 being the HumanoidRootPart Attachment with Attachment1 being the Physics Hand’s Attachment. Anything I have to fix to solve it from being backwards?

1 Like

I think I did it correctly, I can push myself off walls, however I can’t actually pull myself up a ledge

1 Like

Maybe you don’t have enough force then?

1 Like

When I set the Max Force higher, it becomes super weird and buggy as you see here:

1 Like

I’m not sure then, if you want, you can add me on Discord and I can assist you further.
aerecura#2022

2 Likes

Alright thanks, I just added you

1 Like