Check out example codes for "how to change the axis of a Vector3 variable". It will help you in understanding the concepts better.
Code Example 1
Vector3 playerPosition = new Vector3(0, 0, 0);
void Update()
{
Input.Getkey("w")
{
playerPosition = transform.position;
playerPosition.x -= 1f;
transform.position = playerPosition;
}
}
Learn ReactJs, React Native from akashmittal.com