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

Is there a way to move all parts of a model when cloning a model?

I need to clone an object from rep storage with a script, and I know how, but I'm just wondering if there's a way I can move every single part part in the model to its position relative to that model without scripting every part to go to a position.

1 answer

✓ Accepted answer

You can use a function of Model known as :MoveTo(). This will set the PrimaryPart's position to any given Vector3.

####Note: You must set a PrimaryPart before proceeding.

workspace.Model:MoveTo(Vector3.new(0, 0, 0))

4 comments

0

Another method with more utility would be model:SetPrimaryPartCFrame(CFrame.new(...)). MoveTo does not allow for rotations.

0

Thank you for suggesting this alternative!

1

I prefer SetPrimaryPartCFrame in most cases for the rotation as well as the lack of collision. Make sure to set a primary part though!

0

Thank you Ziffixture that worked

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