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

How do i make a object go to position on click?

Asked by 4 years ago

hey, im new here... and i need to know this, to make a drawer go to position on click. I already have a click detector script. here is it:

function onClicked(mouse)



end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

but idk how i make this lol, can someone help me saying how i can make a object go to location? like vector3 or something, idk to much of these things... im not saying how to do a complete script, i just wanna know how to do the object move to location on click.

1 answer

Log in to vote
0
Answered by 4 years ago

While using Vector3, you will want to change the part's position property to the coordinates on the plate. This is what you would use to do that:

function onClicked(plr)
    script.Parent.Position = Vector3.new(0,0,0) --You would change the 0's to the location
end

script.Parent.ClickDetector.MouseClick:Connect(onClicked)

0
thanks man, worked TinkyWinkyDev 6 — 4y
Ad

Answer this question