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

This MoveTo function does not work properly when called, why?

Asked by 7 years ago

Hi there, I am here asking why this MoveTo script does not work. I am not getting any errors, and everything works fine; however, when I call the MoveTo function, it moves the part very far away instead from where the mouse was clicked.

Here's the section of the script:

if clickDetector then
    print("Working")
    clickDetector.MouseClick:connect(function()
        local seededDirtClone = seededDirt:Clone()
        seededDirtClone.Parent = garden
        seededDirtClone:MoveTo(Vector3.new(target.Position))
    end)
end

Any help would be very appreciated!

1
Since "target.Position" is already a Vector3 value, you don't require to use the Vector3 function. TheeDeathCaster 2368 — 7y
0
You don't show how "target.Position" is created. Try printing it out. Look for where you assign to it and print out its value after that, too - if it doesn't print out when/what you expect, you'll have to look for alternative solutions. chess123mate 5873 — 7y

Answer this question