Moving Objects In Vr

I am creating a vr project and was just wondering if anyone knew how to move an object by looking at another. For example I want to move a green cube by looking at a red cube making it move a certain amount of blocks.

You would have to determine if the object is in the camera’s field of view. Then I would probably parent the object to your camera so it inherits the rotation of your head.