A bug on my ledge climbing system!

Hello, a few days ago i decided to make a ledge climbing system with the feature to move left and right. My issue consist in the HRP movement: basically when i try tweening the HRP to the next ledge, the character start rotating and moving just the camera, but my goal is to move the HRP to the next position. I looked over the developer hub but i didn’t find any other solution, but i still got a very useful script to calculate end points.

uis.InputBegan:Connect(function(input, istyping)
	if not istyping then
		if input.KeyCode == Enum.KeyCode.A then
			if climbing then
				local Info = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.In,1000000000000,true,.8)
				local goals = {

					Position = p2.Position;
				}
				local tween = game:GetService("TweenService"):Create(hrp,Info,goals)
				tween:Play()
			end
		end
	end
end)
1 Like

If you don’t want the character to rotate with the camera, try setting the Humanoid.AutoRotate to false. Whenever the player is walking again, just set it back to true.

1 Like

I tryed but sadly nothing changed: the character keep rotating and not moving.

uis.InputBegan:Connect(function(input, istyping)
if not istyping then
if input.KeyCode == Enum.KeyCode.D then
if climbing then
local Info = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.In,1000000000000,true,.8)
local goals = {

				Position = p3.Position;
			}
			local tween = game:GetService("TweenService"):Create(hrp,Info,goals)
			tween:Play()
		end
	end
end

end)
uis.InputBegan:Connect(function(input, istyping)
if not istyping then
if input.KeyCode == Enum.KeyCode.Space then
if climbing then
local Info = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.In,1000000000000,true,.8)
local goals = {

				Position = p1.Position;
			}
			local tween = game:GetService("TweenService"):Create(hrp,Info,goals)
			tween:Play()
		end
	end
end

end)

uis.InputBegan:Connect(function(input, istyping)
if not istyping then
if input.KeyCode == Enum.KeyCode.S then
if climbing then
local Info = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.In,1000000000000,true,.8)
local goals = {

				Position = p4.Position;
			}
			local tween = game:GetService("TweenService"):Create(hrp,Info

uis.InputBegan:Connect(function(input, istyping)
if not istyping then
if input.KeyCode == Enum.KeyCode.D then
if climbing then
local Info = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.In,1000000000000,true,.8)
local goals = {

				Position = p1.Position;
			}
			local tween = game:GetService("TweenService"):Create(hrp,Info,goals)
			tween:Play()
		end
	end
end

end)
uis.InputBegan:Connect(function(input, istyping)
if not istyping then
if input.KeyCode == Enum.KeyCode.W then
if climbing then
climbin = true
local Info = TweenInfo.new(.4,Enum.EasingStyle.Sine,Enum.EasingDirection.In,1000000000000,true,.8)
local goals = {

				Position = p3.Position;
			}
			local tween = game:GetService("TweenService"):Create(hrp,Info,goals)
			tween:Play()
			tween.Completed:Connect(function()
				climbing = false
				climb = false
				climbin = false
			end)
		end
	end
end

end)

This code is attached to the HumanoidRootPart.

Well this works, but i already solved by using CFrame but thanks anyways!

This might work, but it seems that your tweens will stop running after 818.317 years, because it loops 1,000,000,000,000 times. You should use -1 instead so it loops infinitely. And, well, it looks less messy.

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