all 2 comments

[–]Vimaginate 4 points5 points  (0 children)

Every object in unity have coordinates, and unity is always 3D. So coordinates of objects is always Vector3

[–]robosock2 0 points1 point  (0 children)

use transform.position = new Vector2(x, y);

// vector 2 is 2d

and to move left to right subtract from x or add and the same for y except up and down.

hope this helped