'How to get the screen central position in arkit?

I set a beat sight in the middle of the screen, and when I tap the screen and fire a bullet, on the ipad the beat sight and bullet are in the same position as expected, but on iphone (11) the bullet position is above the beat sight.

on ipad enter image description here on iphone

enter image description here

The beat sight config is below

enter image description here

And the bullet position is below

   guard let pointOfView = sceneView.pointOfView else {return}
        let transform = pointOfView.transform
        let orientation = SCNVector3(-transform.m31, -transform.m32, -transform.m33)
        let location = SCNVector3(transform.m41, transform.m42, transform.m43)
        let position = orientation + location

Does anyone know how to solve it? Thanks a lot.



Sources

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

Source: Stack Overflow

Solution Source