Move to click?

How do you make it so that when you click somewhere on a terrain, an object will move to it?

Maybe a Raycast ? You retrieve the position of the contact and you do your stuff.