# Touch events when using the Object Placement project

**URL:** <https://community.nianticspatial.com/t/touch-events-when-using-the-object-placement-project/3321>\
**Category:** I'm Stuck\
**Created:** [February 26, 2023, 8:23pm UTC](https://community.nianticspatial.com/t/touch-events-when-using-the-object-placement-project/3321 "2023-02-26T20:23:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Dunn](https://avatars.discourse-cdn.com/v4/letter/n/ecb155/32.png) [@Nick\_Dunn](https://community.nianticspatial.com/u/Nick_Dunn)\
**Post date:** [February 26, 2023, 8:23pm UTC](https://community.nianticspatial.com/t/touch-events-when-using-the-object-placement-project/3321/1 "2023-02-26T20:23:45Z")

</div>

Hi,

Just switched from AR Foundation as it was too glitchy. I’m running the Object Placement example and I want to be able to hit play on a video in the environment. How do I do that without it just moving the object I have placed?

Nick

- **Device type & OS version** : iOS / iPhone 12 with IOS 16.  
x.x

- **Xcode version** : 14

- **ARDK version** :

- **Unity version** : 2020.3.40

Description of the issue:

---

<div class="post-metadata">

**Author:** ![Stacy](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Stacy](https://community.nianticspatial.com/u/Stacy)\
**Post date:** [March 1, 2023, 7:43pm UTC](https://community.nianticspatial.com/t/touch-events-when-using-the-object-placement-project/3321/2 "2023-03-01T19:43:43Z")

</div>

Hello Nick,

There is a method within Unity that can detect when your pointer is over a UI object, such as a menu or video, called `IsPointerOverGameObject`. You can find an example of this implementation in the Event Systems component in the UnityUI package found in your Project View.

![](https://lh3.googleusercontent.com/t6S4wM5Ovq7Y4cXqgIpFdAmeqVA6FjJVWos1lBqPD1nXxlu2vGW4XIqdo4lrfpp0kQJyZ-DUS3uHSwnGWjSu9zuH4S5q0ogOhRA_IQlJeKorRaSE4HAQk-TW3_bzcBBZzkkCSRU03I2_s-c44MiUd3U)

By including this method in an ‘if statement’ of the Object Placement example’s Placement Controller script, you could prevent your object from moving if the clicked object was UI.

Alternatively, you could try a Raycast that allows objects to be moved/spawned only if you’re clicking something that is, for example, not on the UI layer. I hope this helps get you started!

---

<div class="post-metadata">

**Author:** ![Maverick\_Niantic](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Maverick\_Niantic](https://community.nianticspatial.com/u/Maverick_Niantic)\
**Post date:** [March 5, 2026, 11:44pm UTC](https://community.nianticspatial.com/t/touch-events-when-using-the-object-placement-project/3321/3 "2026-03-05T23:44:55Z")

</div>

Age
