Need to get rotation x,y,z of object but rotation stops if I use localEulerAngles

Hi
I have a cube I am rotating in space using buttons. I am using transform.Rotate to rotate the cube and transform.localEulerAngles.x (y,z) to get the Vector3 components needed to stop the cube in place. However, the transform.localEulerAngles only works up to 180 degrees Y and 90 degrees X, then the cube stops rotating. Transform.Rotate doesn’t seem to have any way to get the x,y,z components. Here’s my code. Any help will be greatly appreciated.

 if (cubeDoThis == "cubeRotUp") {
            transform.Rotate(-Time.deltaTime * (moveCubeSpeed * 2), 0, 0);
            rotX = transform.localEulerAngles.x;
            rotY = transform.localEulerAngles.y;
            Debug.Log("rotX: " + transform.localEulerAngles.x +  "  rotY: " + transform.localEulerAngles.y);
        }

    }
    public void CubeStop() {
        transform.position = new Vector3(posX, posY, 0);
        transform.localEulerAngles = new Vector3(rotX, rotY, 180.0f);
    }

Hi, Never mind! I found that all I need to stop movement of both the position and the rotation of the cube is this line of code:

        transform.position = new Vector3(posX, posY, 0);

Sometimes I over-think things :slight_smile:
Zaffer