Hello, I am trying to move a model, so I welded every other par in the model to the body. Even I welded every other part to the body, only the body moves. I want to make everything move in the model, how can I achieve this? Thank you.
Here is my script (It’s located in the model, and it’s a Script):
local car = script.Parent.Body
car.Vector3.new(10, 0, 0)
Add an invisible part in the centre of the car and rename it to ‘Primary’. Then go to the model, click primary part and set it to the part called, ‘Primary’. Then simply do this in your script:
local car = script.Parent
car:SetPrimaryPartCFrame(car:GetPrimaryPartCFrame() * Vector3.new(10,0,0))
function slideTo(obj,goalVector)
local sP = obj:GetPrimaryPartCFrame()
for i = 0, 1.01, 0.01 do
print(i)
obj:SetPrimaryPartCFrame(sP:Lerp(CFrame.new(goalVector),i))
wait(0.03) -- change number, smaller the faster. limit is 0.03
end
end
slideTo(script.Parent, Vector3.new(100,0,0)) -- run for smooth.