Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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)

1 comment

0

thanks man, worked

This discussion is preserved as it was. New answers, comments, and votes are closed.