Reproduction Steps:
Step 0. Ensure “New Luau type solver” is enabled in beta features.
Step 1. Open a place in Roblox Studio
Step 2. Create a script
Step 3. Paste the attached content inside the script
Step 4. Your connection (and, anyone else connected in Roblox Studio) will crash and, if it’s published, will not reopen unless you manually rollback your game from the Creator Hub.
My System Information:
NOTE: I’ve verified this is happening on other systems too.
MacBook Pro 16-inch, 2021, Apple M1 Pro, 16GB. MacOS Sequoia 15.4.1.
Roblox Studio Verssion 0.673.0.6730711 (arm64)
A private message is associated with this bug report
1 Like
Having the same issue, I am on a MacBook Air M2, 8 GB, MacOS Sequoia 15.4.1
Attached is some code I was able to get to reproduce this issue:
--[[
Script: ServerScriptService → “AdaptiveBezierRoad”
Requirements:
• A ModuleScript “Bezier” alongside this script
• Four anchor Parts in Workspace named P1, P2, P3, P4
• A Model named “RoadSegment” in ReplicatedStorage
– RoadSegment.PrimaryPart must be set
– The mesh’s “forward” axis runs along local +X
--]]
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Workspace = game:GetService("Workspace")
local Bezier = require(script:WaitForChild("Bezier"))
local curve = Bezier.new(workspace.P1, workspace.P2, workspace.P3, workspace.P4)
local roadTemplate = ReplicatedStorage:WaitForChild("RoadSegment")
-- How sharply we allow the road to turn (in radians)
local MAX_ANGLE = math.rad(8)
-- If your mesh’s forward is +X, we need to rotate lookAt’s –Z→+X by –90° about Y.
-- If it faces –X, swap to +90°.
local ALIGN_FIX = CFrame.Angles(0, math.rad(-90), 0)
-- ——————————————————————————————————————————
-- Recursively subdivide [t0,t1] until the angle between
-- tangents ≤ MAX_ANGLE, returning a sorted list of all t's.
-- ——————————————————————————————————————————
local function getAdaptiveTs(curve, t0, t1, maxAngle, out)
out = out or { t0, t1 }
local i = 1
while i < #out do
local ta, tb = out[i], out[i+1]
local d0 = curve:CalculateDerivativeAt(ta).Unit
local d1 = curve:CalculateDerivativeAt(tb).Unit
local angle = math.acos(math.clamp(d0:Dot(d1), -1, 1))
if angle > maxAngle then
-- insert midpoint and re-evaluate this segment
table.insert(out, i+1, (ta + tb) * 0.5)
else
i = i + 1
end
end
return out
end
-- ——————————————————————————————————————————
-- Build our adaptive t-values once
-- ——————————————————————————————————————————
local ts = getAdaptiveTs(curve, 0, 1, MAX_ANGLE)
local segmentCount = #ts
-- Clone one RoadSegment per t
local segments = {}
for i = 1, segmentCount do
local clone = roadTemplate:Clone()
clone.Parent = Workspace
table.insert(segments, clone)
end
-- ——————————————————————————————————————————
-- Main loop: reposition every segment along the curve
-- ——————————————————————————————————————————
while true do
for i, t in ipairs(ts) do
local seg = segments[i]
local pos = curve:CalculatePositionAt(t)
local tangent = curve:CalculateDerivativeAt(t)
-- point –Z at tangent, +Y up, then align to mesh’s +X
local baseCf = CFrame.lookAt(pos, pos + tangent, Vector3.yAxis)
local finalCf = baseCf * ALIGN_FIX
seg:SetPrimaryPartCFrame(finalCf)
end
task.wait()
end
As a brief follow-up, just to be absolutely clear, this is reproducible on an empty baseplate. By simply pasting the script, as described in the repro steps, you should be able to replicate the issue.
Hello, and thank you for beta testing the New Luau Type Solver. I’m sorry you’re running into this crash. I appreciate the reproduction script: crashes are incredibly frustrating to encounter, and often difficult to diagnose from afar, so this really helps us fix the root issue.
I’ll look into it and try to keep y’all in the loop on any updates.
1 Like
This happens to be the bug I’ve been actively working on for awhile now. I think I’m close to a solution.
Stay tuned!
4 Likes