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

Ways to move a whole model?

In the past I have tried to move the whole model but I have realized I need to have a Primary Part and I need to SetPrimaryPartCframe. For some reason this didn't work(theres a question on this I have you can answer) So are there any other ways of moving a whole model other than the above, Move-To or moving parts individually.

Here is a link to that question: https://scriptinghelpers.org/questions/37710/the-whole-model-wont-move

1 comment

1

SetPrimaryPartCFrame is your best bet. Your code doesn't work on your other post because you don't use this function.

1 answer

✓ Accepted answer

To set a models primary cframe you want to use the Model:SetPrimaryPartCFrame()

For example;

game.Workspace.Model:SetPrimaryPartCFrame(CFrame.new(0,25,0))

Make sure you set a primary part, weather you use the Property or a script.

Note; Usually that part is the center of the object as it will move along its origin of the model.

If you want to use anything like lerp or any type of interpolation, since it can be confusing, you can use it like this

for i = 0,1,0.1 do
	wait()
	game.Workspace.Model:SetPrimaryPartCFrame(game.Workspace.Model.PrimaryPart.CFrame:lerp( CFrame.new(0,25,0),i) )	
end

Sorry for the extra unnecessary code but i feel like it could help out in the future if you decide to use anything relative :)

http://wiki.roblox.com/index.php?title=API:Class/Model/SetPrimaryPartCFrame

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