I am trying to make a movement script that moves multiple parts in one model.
Since for whatever reason you can’t move model CFrames (even though they contain them), I am trying to use other ways to move the model’s children instead, however,
I can’t seem to work out how to group them together so I don’t have to go through 100 functions and rename each part to the correct variable.
So, is there any way for me to somehow assign them all to one variable, or do I just have to sit down for 30 minutes and change this script?
local model = -- your model reference
local children = {} -- table to store references to the children
-- Get the children of the model and store them in the table
for _, child in ipairs(model:GetChildren()) do
table.insert(children, child)
end
-- Now you can access the children using the table
for _, child in ipairs(children) do
-- Perform operations on each child
child.Position = Vector3.new(0, 0, 0) -- Example: Set the position to (0, 0, 0)
end
You could try making a new part inside of the model and setting it as the primary part. Then you can weld all of the parts that you want to move, to the primary part. This will allow you to move all of the parts just by changing the CFrame of the primary part.
It’s a CFrame movement script (it uses frames, which is why it’s called CFrame) so that would not work, I already tried that a few weeks ago for another script too