transform.position.y problem

i’m trying to create an AI algorithm for my bot but i believe that transform.position.x{get} works while transform.position .y is not.
I’ve tried print the position as Vector3 and it’s updating so that x but y is not.
beside the first if statement it work it’s fine while the second one doesn’t.

`
if (randomCube.name.Equals(“Cube (1,2)”))
{

        if (Mathf.Floor(transform.InverseTransformDirection(bot.transform.position).x) != Mathf.Floor(target.x) && !reach)
        {
           rigidbody.AddForce(moveDirection);
        }
        else
        {
            reach = true;
            print(true);
            bot.transform.position = new Vector3(target.x, 2.25f, target.z);
        }
    }
    else if(randomCube.name.Equals("Cube (0,1)") || randomCube.name.Equals("Cube (0,3)"))
    {
        if (Mathf.Floor(bot.transform.position.y) != Mathf.Floor(target.y) && !reach)
        {
            print(bot.transform.position.y);
            print(target.y);
            rigidbody.AddForce(moveDirection);
        }
        else
        {
            reach = true;
            print(true);
            bot.transform.position = new Vector3(target.x, 2.25f, target.z);
        }
    }

`

Do you intend for it to move up? Remember Y in Unity is a vertical coordinate. Try z instead.

wow i already forgot, it’s worked thanks in regard.