How do I set and get the position of a object?

How do I set and get the position of a object in vector 3 form?

Edit: I am using C#

Assuming you’re using C#…

transform.position = new Vector3(10, 20, 30);

Getting the position is just accessing transform.position.

Vector3 p = transform.position;

Relevant documentation:

Transform class

Vector3 class

float x = transform.position.x;

Thanks so much but how can I get the position in (x, y, z)