I’m trying to clone a model and use :MoveTo to move it 15 studs away from the previous clone.
The thing is, it can get the proper position… but it just doesn’t move the model and I can’t figure out why.
I’ve tried rewriting it multiple ways but no matter what I do, the problem remains that the cloned models don’t move to the positions given. Here’s the code:
local folder = script.Parent
local OGsmash = folder.SmasherD --The model I'm cloning
local distance = 15 --Distance away from the previous clone
for i=1,10 do
task.wait(2)
local clone = OGsmash:Clone() --Clones the model
local goal = OGsmash.PrimaryPart.Position + Vector3.new(0,0,distance) --Creates a new position based on the previous model/clone location
clone:MoveTo(goal) --Here lies the problem. It won't move it to the position. I've tried SetPrimaryPart and PivotTo as well.
clone.Parent = folder
distance += 15 --Adds 15 studs to the distance so the next clone moves further
end
Basically, this code just takes the Model in workspace, clones it, creates a position 15 studs away, moves the clone there, adds an extra 15 studs to the distance, then the code loops and the next clone is moved 30 studs away instead, creating a row of models.
I know this code might just be chicken scratch, I’m very VERY new to scripting. Could anyone help me figure out how to actually move the model? (Yes, the model has a PrimaryPart)