# Have user place 3d arkit object (swift4)

**URL:** <https://forums.kodeco.com/t/have-user-place-3d-arkit-object-swift4/53756>\
**Category:** Swift\
**Created:** [October 24, 2018, 8:53pm UTC](https://forums.kodeco.com/t/have-user-place-3d-arkit-object-swift4/53756 "2018-10-24T20:53:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![timswift](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/timswift/32/110937_2.png) [@timswift](https://forums.kodeco.com/u/timswift)\
**Post date:** [October 24, 2018, 8:53pm UTC](https://forums.kodeco.com/t/have-user-place-3d-arkit-object-swift4/53756/1 "2018-10-24T20:53:08Z")

</div>

Right now in my ark app. My 3d object just shows up. I would like to have the user to be able to control where they place the object using the touches began function. I would like the user to be able to place the object as many times as they desired.

```
                   @IBOutlet var sceneView: ARSCNView!

    override func viewDidLoad() {
super.viewDidLoad()

// Set the view's delegate
sceneView.delegate = self

// Show statistics such as fps and timing information
sceneView.showsStatistics = true

// Create a new scene
let scene = SCNScene(named: "art.scnassets/dontCare.scn")!

// Set the scene to the view
sceneView.scene = scene
    }

    override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

// Create a session configuration
let configuration = ARWorldTrackingConfiguration()

// Run the view's session
sceneView.session.run(configuration)
    }

   override func viewWillDisappear(_ animated: Bool) {
       super.viewWillDisappear(animated)

// Pause the view's session
sceneView.session.pause()
  }

    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {

    }

```

---

<div class="post-metadata">

**Author:** ![gdelarosa](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/gdelarosa/32/109063_2.png) [@gdelarosa](https://forums.kodeco.com/u/gdelarosa)\
**Post date:** [October 29, 2018, 6:48pm UTC](https://forums.kodeco.com/t/have-user-place-3d-arkit-object-swift4/53756/2 "2018-10-29T18:48:10Z")

</div>

Hi @timswift, thank you for posting on here. Have you checked out Apple’s sample code using ARKit? [Handling 3D Interaction and UI Controls in Augmented Reality](https://developer.apple.com/documentation/arkit/handling_3d_interaction_and_ui_controls_in_augmented_reality). Although their example doesn’t appear to use touchesBegan, it might be something worth reading through and possibly trying out.

Best,  
Gina

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [April 9, 2019, 1:07pm UTC](https://forums.kodeco.com/t/have-user-place-3d-arkit-object-swift4/53756/3 "2019-04-09T13:07:36Z")

</div>

This topic was automatically closed after 166 days. New replies are no longer allowed.
