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

How do I move all the parts inside a model?

Instead of moving all the parts of the model one by one, is there a better way to do it?

2 comments

1

SetPrimaryPartCFrame is the function that you might be looking for.

0

By the way to add on to what @Kate_Ai said, to use it reference the objects and do the following: Object:SetPrimaryPartCFrame(CFrame.new(0,0,0)) That would set the part to 0,0,0. I recommend setting a invisible part centered in the model or else you will have a weird offset.

1 answer

✓ Accepted answer

Issues with your post.

You did not show any attempt at trying to move the model itself. Please try to show some type of effort please.

What to look into.

Ways to learn more about model moving. Model MoveTo | Model Primary Parts. | Model

What I did.

Alright so I used a RemoteEvent, a GUI Button, Part Primary & MoveTo:

Script that moves the part when the event is called.

--Made by MillerrIAm
----------------Variables-------------
Model = game.Workspace.Parts
RemoteEvent = game.ReplicatedStorage.MovingModelRemote
---------------Main Script--------------
RemoteEvent.OnServerEvent:Connect(function(Player,Position)
	if Position == "SetOne" then
		Model:MoveTo(Vector3.new(-35, 0.5, -27.4))
	elseif Position == "SetTwo" then
		Model:MoveTo(Vector3.new(-35, 0.5, -42.8))
	end
end)

GUI Button that calls the event.

--Made by MillerrIAm
----------------Variables-------------
RemoteEvent = game.ReplicatedStorage.MovingModelRemote
---------------Main Script--------------
script.Parent.MouseButton1Click:Connect(function()
	RemoteEvent:FireServer("SetOne")
end) 

1 comment

1

Thanks

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