Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you properly use :MoveTo()?

Asked by
thePyxi 179
4 years ago
Edited 4 years ago

I'm trying to place a NewModel in front of another (CurrentModel) based on the CurrentModel's position but it doesn't seem to be enjoying what I coded.

1 answer

Log in to vote
1
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

:MoveTo, is a method of Model, that allows you to adjust it’s current Vector3 position. Similar to SetPrimaryPartCFrame, it requires the respective datatype to adjust accordingly.

local Model = workspace.Model

Model:MoveTo(workspace.Location.Position) --// a Vector3 datatype .
0
If there was a second model, I refer the model's position if I want to place the second model? NewModel:Move(OldModel.Position + Vector3.new(10,0,0)) thePyxi 179 — 4y
0
Yep, remember it’s MoveTo() Ziffixture 6913 — 4y
0
I would think that would work, but what I'm working on, that's not happening. thePyxi 179 — 4y
1
If you wish, try NewModel:SetPrimaryPartCFrame(OldModel.CFrame + Vector3.new(10,0,0)) Ziffixture 6913 — 4y
Ad

Answer this question