0

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

TomsGames 225
7 years ago

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!

0
1waffle1 2898
7 years ago

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)