Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Move replica model with additions to the exact same place as another model?

Model bc = bluecar Model ebc = editbluecar

ebc:MoveTo(bc:GetModelCFrame()) doesn't work as MoveTo uses Vector3.. But I also want the model to be rotated. Yet I am taking into account the cframe of a model is the center, it's the same size (a replica) just with an addition.

TY!

1 answer

✓ Accepted answer

To move model1 to model2

model1=Model
model2=Model

local a=model1:GetModelCFrame()
local b=model2:GetModelCFrame()
local c=a*b:inverse()
function getparts(m)
	for _,v in pairs(m:GetChildren())do
		if v:IsA("BasePart")then
			v:BreakJoints()
			v.CFrame=c*v.CFrame
			v:MakeJoints()
		end
		getparts(v)
	end
end
getparts(model1)

This discussion is preserved as it was. New answers, comments, and votes are closed.