Hello
I am trying to move a model using script but for some reason, it is not working. ('Door' is the model. I have set the model's primary part to the main part inside the model already)
script.Parent.Touched:Connect(function() game.Workspace.Door:MoveTo(Vector3.new(87.065, 3.843, -16.842)) script.Parent:Destroy() end)
You cannot move a model like that, you must move the primary part of the model instead. I also believe MoveTo only works with humanoids. try:
script.Parent.Touched:Connect(function() game.Workspace.Door.PrimaryPart.Position = Vector3.new(87.065, 3.843, -16.842) script.Parent:Destroy() end)
Someone else suggested using Model.PrimaryPart.Position
, but I suggest you use Model:SetPrimaryPartCFrame(CFrame)
if you are trying to move parts and keep constant offset.
Sorry. I figured out the issue. The script was correct but all my other models were named Door. To fix this issue, I simply changed my main door model to another name.