You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Move a model to a given position
-
What is the issue? The part isnt moving to the correct position, The screenshot below shows the output from the script that moves the model. The Yellow is the model I’m trying to move, the gray part is the position it shows in the output (The spot i want it to go).
- What solutions have you tried so far? I’ve tried both MoveTo and PivotTo but neither made any difference.
The model does have a primary part, I’m not sure if I’ve set it wrong, Hirearchy of the model is below. Primary part circled. Parts in the screenshot can be seen in the screenshot above, they are the yellow parts.
Script that moves the part, The plot value being passed is an object. It prints the object correctly.
folder.Planting.OnServerEvent:Connect(function(plr, plant, plot)
if plr.stats[plant].Value >= 1 then
print(plr, plant, plot)
local clone = folder.Seeds:FindFirstChild(plant):Clone()
local newPosition = plot.Position + Vector3.new(0, 0.5, 0)
clone:MoveTo(newPosition)
print(newPosition)
clone.Parent = plot
clone:FindFirstChild("Growing").Value = true
plr.stats[plant].Value -= 1
end
end)
Edit: No errors, The spot that the model is at in the screenshot at the top is the default position of the model.