This is a very quick tutorial on how to change the position of a model!
Quick Breakdown
When moving a model, you don’t use CFrame or Position like normal with parts, in this tutorial I will be showing you how to use :PivotTo (though there are other options).
Actual Tutorial
To start, declare a model or have a model variable ready.
local myModel = workspace:WaitForChild("myModel")
Then, get a CFrame ready like so:
local myModel = workspace:WaitForChild("myModel")
local CFrame = CFrame.new(55, -2, 9) -- You can add the rest of the parameters if needed.
Finally, we will use :PivotTo() to move the model like so:
local myModel = workspace:WaitForChild("myModel")
local CFrame = CFrame.new(55, -2, 9) -- You can add the rest of the parameters if needed or use yourPart.CFrame.
myModel:PivotTo(CFrame)
Now you are done! There is one more thing I’d like to show you.
If you are trying to move your model to another model, then you can do it like so:
local myModel = workspace:WaitForChild("myModel")
local CFrame = workspace:WaitForChild("myModel2"):GetPivot()
myModel:PivotTo(CFrame)
We use :GetPivot() on a model to get it’s pivot information to simplify our code.
You made it! Congrats, and thank you
Script For Lazy Readers
local myModel = workspace:WaitForChild("myModel")
local CFrame = CFrame.new(55, -2, 9) -- You can add the rest of the parameters if needed or use yourPart.CFrame.
myModel:PivotTo(CFrame)
Thank you for reading, and please drop me a follow on Roblox!