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

How would I move an entire model rather than each part individually in a model?

3 answers

✓ Accepted answer
workspace.Model:MoveTo(Vector3.new(x,y,z))

but again if the model is inside of something it will raise the Y value (go upward) until nothing is in the way. When moving a model, it uses the PrimaryPart chosen. If no primary part is chosen it will use the root part of the model.

If you dont want to worry about that, you can do this

local model = game.Workspace.Model

model:SetPrimaryPartCFrame(CFrame.new(5,5,5)) -- 5,5,5 can be any position you want

2 comments

0

The second script worked, thanks for all your help :)

0

np :)

If you want to move it just do this. Pretend the model is in workspace and named "Model"

workspace.Model:MoveTo(12,42,14) -- Just put in the cordinates

5 comments

0

First off, that was quick :D, second this answer is kind of vague, I'd need to know how to get the position of the "center" of the model because it's required for the scripts I'm using.

0

This moves the model to the desired coordinates, but it moves on top of whatever is there. I suggest using SetPrimaryCFrame instead (Look it up), It sets the model's primary part to the excat location

0

Jeez these answers are comin in fast XD, finally I tried the method in the answer and it just gave me an error "Unable to cast double to Vector3", so I'll see if the SetPrimaryCFrame is any good.

0

^ gold forgot to add “Vector3.new()” into the parentheses which is why you’re getting an error. Just add that in the parentheses and put the numbers in the parentheses of the “Vector3.new()”.

0

of you could do MoveTo(Vector3.new(12,42,14)) although MoveTo is not the best way ever to move a model but it is easy

The best way to go at this would be to use :SetPrimaryPartCFrame

Of course, you'll need to make sure that the model has a primary part set.

An example:

local model = game.Workspace.Part
local part = game.Workspace.MovePart

model:SetPrimaryPartCFrame(movepart.Position)

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