function MoveTool.PrepareSelectionForDragging(T)local S={}local v={}local t=Support.FlipTable(Selection.Parts)for T,v in pairs(Selection.Parts)do S[v]={Anchored=v.Anchored,CanCollide=v.CanCollide;CFrame=v.CFrame}v.Anchored=true v.CanCollide=false S[v].Joints=Core.PreserveJoints(v,t)v:BreakJoints()v.Velocity=Vector3.new()v.RotVelocity=Vector3.new()end pcall(function()for T,S in ipairs(Selection.Models)do v[S]={Pivot=S:GetPivot()}end end)local a local u=Selection.Focus if not u then a=nil elseif u:IsA("\066\097\115\101\080\097\114\116")then a=u.CFrame elseif u:IsA("\077\111\100\101\108")then a=u:GetModelCFrame()pcall(function()a=u:GetPivot()end)end return S,v,a end

function MoveTool:PrepareSelectionForDragging()
	local InitialPartStates = {}
	local InitialModelStates = {}

	-- Get index of parts
	local PartIndex = Support.FlipTable(Selection.Parts)

	-- Stop parts from moving, and capture the initial state of the parts
	for _, Part in pairs(Selection.Parts) do
		InitialPartStates[Part] = {
			Anchored = Part.Anchored;
			CanCollide = Part.CanCollide;
			CFrame = Part.CFrame;
		}
		Part.Anchored = true;
		Part.CanCollide = false;
		InitialPartStates[Part].Joints = Core.PreserveJoints(Part, PartIndex)
		Part:BreakJoints();
		Part.Velocity = Vector3.new();
		Part.RotVelocity = Vector3.new();
	end;

	-- Get initial model states (temporarily pcalled due to pivot API being in beta)
	pcall(function ()
		for _, Model in ipairs(Selection.Models) do
			InitialModelStates[Model] = {
				Pivot = Model:GetPivot();
			}
		end
	end)

	-- Get initial state of focused item
	local InitialFocusCFrame
	local Focus = Selection.Focus
	if not Focus then
		InitialFocusCFrame = nil
	elseif Focus:IsA 'BasePart' then
		InitialFocusCFrame = Focus.CFrame
	elseif Focus:IsA 'Model' then
		InitialFocusCFrame = Focus:GetModelCFrame()
		pcall(function ()
			InitialFocusCFrame = Focus:GetPivot()
		end)
	end

	return InitialPartStates, InitialModelStates, InitialFocusCFrame
end;
