Player orientation not changing despite it changing in script

In my climbing script, my player’s orientation isn’t changing as it should be. The player should be completely straight, but for some reason, occasionally it doesn’t.

if not playerIsClimbing then
					hum.PlatformStand = true
					hrp.CFrame = CFrame.lookAt(raycastResult.Position, raycastResult.Position + Vector3.new(0,0,-1))
								
					local alignPosition = Instance.new('AlignPosition')
					alignPosition.Parent = hrp
					
					local attachment0 = Instance.new("Attachment")
					attachment0.Name = "Attachment0"
					attachment0.Parent = hrp
					
					local attachment1 = Instance.new('Attachment')
					attachment1.Name = "Attachment1"
					attachment1.Parent = wall
					attachment1.WorldPosition = raycastResult.Position
					
					alignPosition.Attachment0 = attachment0
					alignPosition.Attachment1 = attachment1
					
					hrp.Orientation = Vector3.new(0,0,0) --- Right here
					hum.AutoRotate = false
					playerIsClimbing = true
				end

1 Like

hrp.CFrame = CFrame.new(hrp.Position) * CFrame.Angles(0, 0, 0)

1 Like