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)
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.
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
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.