Cloning and Moving the model

I need help cloning and moving the model. The function below clones and is suppose to move a model to a position. Everything works except for the moving part. The cloned model does not go to the specified position.


function regenerate()
	model:remove()
	model = backup:clone()
	model.Parent = game.Workspace
	model.Position = Vector3.new(53.241, 7.145, 422.68)
	model:makeJoints()
end

Models do not have position like parts. Instead use
:PivotTo()
to move a model

2 Likes

you can assign the model a primary part, then use :SetPrimaryPartCFrame to set position.

model:SetPrimaryPartCFrame(CFrame.new(Vector3.new(position)))
1 Like

true, but SetPrimaryPartCFrame is deprecated, if I remembered

2 Likes

esta es la solucion pero tambien use :pivotTo()

3 Likes

As users said above, I can, but it is deprecated, and so It won’t work in the future :slight_smile:

2 Likes

Okay. Feel free to use :PivotTo()

2 Likes

Thank you so much. It works now

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.