Answered by
5 years ago Edited 5 years ago
What your looking to use is the :MoveTo() function for models. you can find documentation on it here.
The moveto() function also moves it out of the way of anything, it won't clip with anything. If you want to move it without it moving out of the way, for example, a door moving into a part, you can find documentation on :SetPrimaryPartCFrame() here.
Now since your really vague with your question and not providing sample code of what you have tried, I can't really give you any code examples. Everything you need is on the wiki pages.
Edit:
I understand what you want now.
1 | local originallocation = model.PrimaryPart.CFrame |
3 | model:SetPrimaryPartCFrame(model.PrimaryPart.Position + Vector 3. new( 1 , 0 , 0 )) |
6 | model:SetPrimaryPartCFrame(originallocation) |
This code example below repeats it forever.
1 | local originallocation = model.PrimaryPart.CFrame |
4 | model:SetPrimaryPartCFrame(model.PrimaryPart.Position + Vector 3. new( 1 , 0 , 0 )) |
7 | model:SetPrimaryPartCFrame(originallocation) |