Nan, -inf, nan position and streaming mesh broking

  • So I have made a plugin that essentially just move all part in a folder and subfolder into a model,Because i wanted to use streaming mesh to better improve performance(since there are lots of road each with multiple wedge in my game),But this happned
  • The model origin position turn into nan, -inf, nan Even Though my plugin only modifies the parent
    *I’ve try change it,But that result in my model going into the null zone,Meaning all part stretch due to floating limit until my screen is completely black
local ChangeHistoryService = game:GetService("ChangeHistoryService")
local Selection = game:GetService("Selection")
-- Create a new toolbar section titled "Custom Script Tools"
local toolbar = plugin:CreateToolbar("MoveStuffTool")
local parent = nil
-- Add a toolbar button named "Create Empty Script"
local target = toolbar:CreateButton("Targeted Stuff", "Targeted Stuff", "rbxassetid://4458901886")
local objectselection = toolbar:CreateButton("Stuff to Move", "Stuff To Move", "rbxassetid://4458901886")
-- Make button clickable even if 3D viewport is hidden
target.ClickableWhenViewportHidden = true

local function onNewScriptButtonClicked()
	local selectedObjects = Selection:Get()
	if #selectedObjects > 0 then
		parent = selectedObjects[1]
	end
	
	
	ChangeHistoryService:SetWaypoint("Selected one")
end
local function MoveInto()
	if parent ~= nil then
		local selectedObjects = Selection:Get()
		if #selectedObjects > 0 then
			for index, descendant in pairs(selectedObjects[1]:GetDescendants()) do
				if descendant:IsA("BasePart") then
					descendant.Parent = parent
				end
			end
		end
		parent = nil
	end
end
target.Click:Connect(onNewScriptButtonClicked)
objectselection.Click:Connect(MoveInto)