The invention discloses a method of a virtual robot; the method includes steps that a host machine 1 carries out space cross chatting and interaction by means of a long-term study user of depth study software through VR and AR glasses or helmets, so that the host machine 1 simulates the user habit to control the virtual body generated by scanning a three-dimensional human body of the user to chat with the chatting object; the invention further discloses a device of the virtual robot; the device comprises glasses or a helmet; 1 is host machine (mobile phone system, CPU, GPU, ROM, RAM, hard disk, external memory, Bluetooth, wireless connection), 2 is loudspeaker, 3 is battery, 4 is camera, 5 is display device, and 6 is microphone.