Change forward direction when using the mouse on player.

void CubeTranslation()

{
    if (MoveLeft)
    {
        CubeX += -0.5f;
    }

    if (MoveRight)
    {
        CubeX += 0.5f;
    }

    if (MoveDown)
    {
        // CubeX += 0.3f;
        CubeZ += -0.3f;
    }

    if (MoveUp)
    {
        // CubeX += 1.3f;
        CubeZ += 0.3f;
        //ToTranslate = true;
    }
    if (RotateLeft)
    {
        controllingObject[0].transform.Rotate(Vector3.left * 1.2f * Input.GetAxis("Mouse Y"));
    
        
        //controllingObject[0].transform.Rotate(Vector3.left * 1.2f);
        //controllingObject[1].transform.Rotate(Vector3.left * 1.2f);
    }
    if (RotateRight)
    {
        //controllingObject.transform.Rotate(Vector3.right * 1.2f);
        controllingObject[0].transform.Rotate(Vector3.right * -1.2f * Input.GetAxis("Mouse Y"));
       

    }

    if (RotateUp)
    {
        //controllingObject.transform.Rotate(Vector3.back * 1.2f);
         controllingObject[0].transform.Rotate(Vector3.up * 1.2f * Input.GetAxis("Mouse X"));

       // controllingObject[0].transform.rotation.y *= 1.2f;
    }
    if (RotateDown)
    {
        //controllingObject.transform.Rotate(Vector3.forward *1.2f);
        controllingObject[0].transform.Rotate(Vector3.down * -1.2f * Input.GetAxis("Mouse X"));
    }

    //controllingObject[0].transform.position = new Vector3(CubeX, CubeY, CubeZ);
    
    if (ToTranslate)
    {
        //controllingObject[0].transform.localPosition = new Vector3(CubeX, CubeY, CubeZ);
        controllingObject[0].transform.Translate(controllingObject[0].transform.forward * 0.3f);
        //.x change x without changing y 
        ToTranslate = false;
    }
}

HEllo @mvirga !

Please ask a question, you just writed a title and posted code… I will not read if don’t know what i’, looking for or what you want to achieve.

:smiley: