How do you attach an object to your camera position with ARKit Swift?

前端 未结 4 1433
走了就别回头了
走了就别回头了 2021-02-02 03:08

I have moving objects which I want to have be able to collide with me the player. I have the ability to launch objects from me by getting my current position/direction at that t

4条回答
  •  无人共我
    2021-02-02 03:56

    Following code work for me to get the current position(x,y,z coordinates) of the camera.

        let pov = sceneView.pointOfView
        let position = pov?.position
    
        let x = position?.x
        let y = position?.y
        let z = position?.z
    

提交回复
热议问题