'Scenekit move object with respect to camera

I've placed a node in Scenekit/ARKit

Now I want to move node/object to right and left with help of buttons. Issue is when I moves my camera/device and press right button, node moves in direction of axis it was first initiated, Not moves right with respect to camera. How can I achieve this?

current code on tapping right button

position.x += 0.2


Solution 1:[1]

Here is the solution

guard let front = sceneView.pointOfView?.simdWorldFront else {return}
let horazontalRight = cross(front, simd_float3(0,1,0))
    
// for moving right
node.position +=  SCNVector3(horazontalRight *  0.01)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Haris