How can I attach character to wall in wall climbing script?

I have a current wall climbing script that works until I need to apply velocity. I think the fact that I use AlignPosition w/ attachments is a problem when it comes to applying velocities to the HRP. How else could I attach the player to the wall?

Aligning position part of script:

					hrp.CFrame = CFrame.lookAt(raycastResult.Position, raycastResult.Position + Vector3.new(0,0,-0.15))	
					hum.PlatformStand = true
					
					local alignPosition = Instance.new('AlignPosition')
					alignPosition.Mode = "OneAttachment"
					alignPosition.Parent = hrp
					
					local attachment0 = Instance.new("Attachment")
					attachment0.Name = "Attachment0"
					attachment0.Parent = hrp
					
					alignPosition.Position = raycastResult.Position
					alignPosition.Attachment0 = attachment0
					
					hrp.Orientation = Vector3.new(0,0,0)
					hum.AutoRotate = false
2 Likes

–Bump

Minimum characters needed

1 Like

–Bump x2

Minimum characters needed

1 Like

Bump x3

—Minimum characters needed

Bump x4 :crying_cat_face:
–Minimum characters needed

What are you using the Velocity for? If it is to move the character around, then I don’t believe it will work as you have effectively welded it to the wall. You could try

  • anchoring the HRP
  • disable the align
  • tween the character to new position
  • re-enable the align

I know there are quite a few examples on the DevForum which other peeps have posted with examples and all operate in a aslightly different manner.

I get the normal from a raycast to align the character, then weld it to the part and tween as above to allow climb mechanics.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.