Hello, I noticed that my rotating model script seperates my parts over time. It works but the pieces get seperated and I don't want that. How can I stop it from seperating?
-- Just put this script in a model to make it rotate
local speed = 25 -- the speed it spins at, change this to how fast you want it to spin
local orig = script.Parent
local rotation = 0
local cf = orig:GetModelCFrame()
function ModelCFrame(Model,Frame)
local search,MidFrame,list = nil,Model:GetModelCFrame(),{}
search=function(a)
for n,o in pairs(a:GetChildren())do
if(o:IsA("BasePart"))then
table.insert(list,o)
end
search(o)
end
end
search(Model)
for n,o in pairs(list)do
o.CFrame=Frame*MidFrame:toObjectSpace(o.CFrame)
end
end
while(wait())do
rotation = rotation+(speed/5)
if(rotation>360)then rotation = 0 end
ModelCFrame(orig,cf*CFrame.Angles(0,math.rad(rotation),0))
end
-- 1Topcop (WebGL3D/Java3D)

2 comments
SetPrimaryPartCFrame(), give the model a primary part then do SetPrimaryPartCFrame(model.CFrame * CFrame.Angles(0,math.rad(90),0))
???, how?