How to use "move to target"?

Alright so I want a ball to move to a cube, I remember watching a tutorial where they used “moveto (target)” or something like that?

I haven’t come across the moveto target and the scripting Unity manual also doesnt show up anything like that, but theres a different way you can do it.

Heres something in JS:

var target : Transform;  
var speed : int;

function Update(){

    transform.position = Vector3.MoveTowards(transform.position, target.position, Time.deltaTime * speed);

just save this and add it to the ball. Once the script is compiled, drag the cube from the heirarchy to the ‘target’ variable.

I know this is super old, but I came across it when I was looking for the same thing this guys was and the answer turned out to be.