2D Position of a game object.

Hi, my question is pretty simple. I’m just trying to get the X and Y position of my game object ( just a cube). After that I want to save these in a var. Btw I’m working in javascript.
Thank you.
-Nelis

you can use transform.position which gives you a Vector3 of world coordinates.

accessing the x and y can be done like this:
transform.position.x and transform.position.y

Good luck