VR grabbing not working with anchored parts for climbing

So basically I want to make climbing in VR, my grabbing script works fine but I have a part that detects if the part is anchored or not so I can make climbing and for some reason it won’t detect the anchored part when I go to grab it… here is my code help is appreciated! Thanks.

UIS.InputBegan:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.ButtonL1 then
		for _, Items in pairs(game.Workspace.Grabbables:GetChildren()) do
			local MaxGrabDis = 1
			if (Items.Position - LeftHand.Position).magnitude <= MaxGrabDis and LeftHeld == false then
				if Items.Anchored == true then
					game.ReplicatedStorage.Remotes.Grab:FireServer(Items, LeftHand)
					local OffSet = Legs.CFrame * -LeftHandReal
					Legs.CFrame = OffSet
					game.ReplicatedStorage.Remotes.Climb:FireServer(OffSet)
					print("Climb")
					LeftHeld = true
				else
					game.ReplicatedStorage.Remotes.Grab:FireServer(Items, LeftHand)
					LeftHeld = true
					UIS.InputEnded:Connect(function(key)
						if key.KeyCode == Enum.KeyCode.ButtonL1 then
							--Weld:Destroy()
							game.ReplicatedStorage.Remotes.UnGrab:FireServer(LeftHand, Items)
							LeftHeld = false
						end
					end)
				end
			end
		end
	end
end)
1 Like

update: so now it recognize the anchored part but now I need to get the climbing math correct

ok so now a dev told me that I should use align position with reaction forces but the thing is, is that I have the hand always goes to like camera CFrame + your real life hand position and stuff which means when I try to move it with an align position it will literally just go to the position it should go with the CFrame math so basically i need to make it so when im climbing the hand will react to align position but still will stay in the correct position i guess so yeah its hard if anyone knows how to do this, help is appreciated

A more simple solution is to have “pegs”, which would be little unanchored parts welded to the anchored wall. OR you could have an unanchored part welded to an anchored part and climb up the unanchored one.

Oh yeah I forgot I solved this a bit ago, sorry

What was the solution? I’m also trying to make VR Climbing

its really hard to explain but i had 2 align positions with reaction force enabled one for the hands to have physics and one connected to the rootpart and the hands idk how to explain but i hope you can figure it out

Isn’t that how you make hand collision?

well yes but its also tied to climbing in a way

i dont really remember what i did but off the top of my head thats what i can think of

Ahhh, the thing I’m trying to find out is that when you hold the grip button on a wall, it welds the hand in place.

ah i dont weld i use an align position to keep the hand there because when i would grab with 2 hands it would completely limit my movement for some reason so i just had a rreally strong align position

Ohh, wait so what would be the (Attachment1) for the AlignPosition to keep the controller in place? Would it be like an anchored part?

well i dont think it matters for me because i turned on reaction force enabled for it iirc

Can you give me step by step on how to make VR Climbing, because I’ve been working on it for like 10 hours and I still haven’t figured it out

im sorry but i have little knowledge of what i originally did you gotta figure it out, sorry man

Ah, Alright. I technically did figure out how to do VR Climbing by positioning the Humanoid Root Part but the entire map was “jittery” when climbing so I had to scratch that method.

Hey, do you remember the settings you used for the Align Position, like the MaxVelocity, Responsiveness, etc?

i do not but i remember they were pretty low

Alright, do you think if I show you a video you can spot what I’m doing wrong? Right now I’m just focusing onto being able to pull myself up ledges.