It’s so weird that this is still an issue, even with the new WeldConstraint
object… 7 years later.
Here are some steps to reproduce:
- Make an array of parts, and weld them together. Have them weld in-order (using welds or weld constraints)
- Unanchor them
The game will now crash. Happens even if it’s just a few parts.
Reproduction script
local COOLDOWN_THRESHOLD = 0.5
local CAN_WELD_NON_ANCHORED = false
local CAN_WELD_THOSE_WITH_CONSTRAINTS = false
local LastFrame = os.clock()
local function MakeWeldRoot(Model : Model) : Part
local Coordinate : CFrame = Model:GetBoundingBox()
local RootPart : Part = Instance.new("Part")
RootPart.Transparency = 1
RootPart.Anchored = true
RootPart.CanCollide = false
RootPart.CanQuery = false
RootPart.Size = Vector3.new(1, 1, 1) * 0.05
RootPart.CFrame = Coordinate
RootPart.Name = "Root"
RootPart.Parent = Model
Model.PrimaryPart = RootPart
return RootPart
end
local function GetQueuedParts(ObjectArray : {[number] : Instance}) : {[number] : BasePart}
local Parts : {[number] : BasePart} = {}
for _, Object in ObjectArray do
if Object:IsA("BasePart") then
if not CAN_WELD_NON_ANCHORED and Object.Anchored == false then
continue
end
if not CAN_WELD_THOSE_WITH_CONSTRAINTS then
local HasConstraints = false
for _, PotentialConstraint : Instance in Object:GetChildren() do
if PotentialConstraint.ClassName:find("Constraint") then
HasConstraints = true
break
end
end
if HasConstraints then
continue
end
end
table.insert(Parts, Object)
end
end
table.sort(Parts, function(a, b)
return a.Position.Magnitude > b.Position.Magnitude
end)
return Parts
end
local function WeldTwoTogether(RootPart : Part, Part : Part, WeldFolder : Folder)
local NewWeld = Instance.new("WeldConstraint")
NewWeld.Part0 = RootPart
NewWeld.Part1 = Part
NewWeld.Parent = WeldFolder
Part.Anchored = false
end
local function WeldModel(Model : Model)
local WeldFolder = Instance.new("Folder")
local Objects = Model:GetDescendants()
local Parts = GetQueuedParts(Objects)
local RootPart = MakeWeldRoot(Model)
WeldFolder.Name = "WeldConstraints"
WeldFolder.Parent = Model
local LastPart = Parts[1]
for _, Part in Parts do
if Part == LastPart then
continue
end
WeldTwoTogether(LastPart, Part, WeldFolder)
LastPart = Part
if os.clock() - LastFrame >= COOLDOWN_THRESHOLD then
task.wait()
LastFrame = os.clock()
end
end
RootPart.Anchored = false
print(`Welded model in location "{Model:GetFullName()}"`)
end
WeldModel(script.Parent)
When done in studio, there is no error message or anything. Studio just immediately crashes.
Log file:
0.580.0.5800572_20230615T165820Z_Studio_A68C5_last.log (76.3 KB)
Log Preview
... Truncated to show after all loading into place, so excludes what led up to opening the file
2023-06-15T16:58:31.786Z,11.786068,2b1c,6 [FLog::StudioUpdate3DView] PlaceSessionPluginWidgetsView; 3DView visibility before update: true, 3DView updatesEnabled before update: true
2023-06-15T16:58:31.836Z,11.836220,1e98,6 [FLog::Warning] Warning:
⏱️ Loading Default Properties
2023-06-15T16:58:32.355Z,12.355273,2f58,12 [DFLog::HttpTraceError] HttpResponse(#472 000001BB20729480) time:456.0ms (net:62.8ms callback:0.0ms timeInRetryQueue:0.0ms)status:403 Forbidden bodySize:53 url:{ "https://apis.roblox.com/content-aliases-api/v1/universes/get-aliases?page=1&universeId=0" } ip:128.116.95.4 external:0 numberOfTimesRetried:0
2023-06-15T16:58:32.813Z,12.813197,5da0,6 [FLog::Warning] Warning:
⏱️ Loading Default Properties
2023-06-15T16:58:32.892Z,12.892177,3604,6 [FLog::Output]
🔎 Now watching for new instances
2023-06-15T16:58:32.938Z,12.938193,49c0,6 [FLog::Warning] Warning:
âś… Default Properties has loaded!
2023-06-15T16:58:33.226Z,13.226150,2b1c,6 [FLog::StudioUpdate3DView] PlaceSessionPluginWidgetsView; 3DView visibility before update: true, 3DView updatesEnabled before update: true
No dump file was generated. The logs seem to not say anything about a crash.