I’m trying to make a ladder and it is perfectly structured like one. I’ve used rope constraints to connect unanchored parts with the first one being anchored.
The problem is whenever I touch a part it moves rapidly and my only solution to this is a while loop setting each and every parts AssemblyAngularVelocity and AssemblyLinearVelocity to Vector3.zero.
I don’t think this is a very performant solution for the server though.
local CollectionService = game:GetService("CollectionService")
local Ladder = {} -- 1 extra ladder part is created to initialize the pattern of the script(always called 0)
Ladder.Visible = true
Ladder.PartColor = Color3.fromRGB(199, 136, 89)
Ladder.PartMaterial = Enum.Material.Wood
Ladder.PartSize = Vector3.new(4,0.25,0.5)
Ladder.Create = function(amount,startPosition,parent)
local lastPart
for i = 1,amount do
local currentPart = Ladder.Part(tostring(i),parent)
if i > 1 then
lastPart = parent:FindFirstChild(tostring(i - 1))
lastPart.RightRope.Attachment1 = currentPart:FindFirstChild("Right")
lastPart.LeftRope.Attachment1 = currentPart:FindFirstChild("Left")
end
if i == 1 then
local firstPart = Ladder.Part(tostring(i-1),parent)
firstPart.Anchored = true
firstPart.Position = startPosition
firstPart.RightRope.Attachment1 = currentPart:FindFirstChild("Right")
firstPart.LeftRope.Attachment1 = currentPart:FindFirstChild("Left")
end
end
end
Ladder.Part = function(indexName,parent)
local part = Instance.new("Part")
part:AddTag("LadderPart")
part.Massless = true
part.Color = Ladder.PartColor
part.Material = Ladder.PartMaterial
part.Size = Ladder.PartSize
part.Anchored = false
part.CanCollide = true
part.TopSurface = Enum.SurfaceType.Smooth
part.BottomSurface = Enum.SurfaceType.Smooth
part.Name = indexName
part.Parent = parent
local rightAttachment = Ladder.Attachment(Vector3.new(1.75, 0, 0),part,"Right")
local leftAttachment = Ladder.Attachment(Vector3.new(-1.75, 0, 0),part,"Left")
local right = Ladder.Rod(part.Right)
local left = Ladder.Rod(part.Left)
return part
end
Ladder.Rope = function(originAttachment) -- Create a rope inside the very first part which attaches to the next part
local rope = Instance.new("RopeConstraint")
rope.Visible = Ladder.Visible
rope.Name = originAttachment.Name .. "Rope"
rope.Attachment0 = originAttachment
rope.Parent = originAttachment.Parent
end
Ladder.Rod = function(originAttachment) -- still has name Rope so i can do less work with this torturous and annoying module
local rod = Instance.new("RodConstraint")
rod.Visible = Ladder.Visible
rod.Length = 1.5
rod.LimitsEnabled = true
rod.LimitAngle1 = 360
rod.LimitAngle0 = 360
rod.Name = originAttachment.Name .. "Rope"
rod.Attachment0 = originAttachment
rod.Parent = originAttachment.Parent
end
Ladder.Attachment = function(offset,parent,name)
local attachment = Instance.new("Attachment")
attachment.Name = name
attachment.Position = offset
attachment.Parent = parent
return attachment
end
return Ladder
Here is my module, any efficient ways to make the unanchored ladder parts not move rapidly under physics.
I’ve tried CustomPhysicalProperties, Rod LimitsEnabled, Massless property, and a while loop in a task.spawn changing the parts Angular and Linear Velocity.