Could I design a first person game and transfer it to Virtual Reality?

I am trying to do resource harvesting/ inventory, so when you have an axe in your hand and chop a tree in virtual reality. If I get the code to make “x” to cut a tree, can I make it where a swing in virtual reality near a tree will trigger the same thing as “x”? I can only find how to do resource harvesting in first person games and I am trying to transfer these functionalities to virtual reality.

Duplicated post