# How can I use semantic segmentation to automatically change game objects per channel?

**URL:** <https://community.nianticspatial.com/t/how-can-i-use-semantic-segmentation-to-automatically-change-game-objects-per-channel/1806>\
**Category:** I'm Stuck\
**Created:** [April 8, 2022, 2:56am UTC](https://community.nianticspatial.com/t/how-can-i-use-semantic-segmentation-to-automatically-change-game-objects-per-channel/1806 "2022-04-08T02:56:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noriko\_Horie](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@Noriko\_Horie](https://community.nianticspatial.com/u/Noriko_Horie)\
**Post date:** [April 8, 2022, 2:56am UTC](https://community.nianticspatial.com/t/how-can-i-use-semantic-segmentation-to-automatically-change-game-objects-per-channel/1806/1 "2022-04-08T02:56:42Z")

</div>

_Include the following details (edit as applicable):_

- **Issue category** : Semantic Segmentation
- **Device type & OS version** : iOS 15.2
- **Host machine & OS version** : Mac on Monterey 12.2.1
- **Xcode version** : 13.2.1
- **ARDK version** : 1.2.0
- **Unity version** : 2020.3.30f1

How can I use semantic segmentation to automatically change game objects per channel?  
[What I want to do].  
When the sky is recognized, the sphere is displayed  
Next, we will look at the  
When the ground is recognized, a box is displayed.  
Hide the ball recognized when sky.

---

<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:** [April 8, 2022, 9:12pm UTC](https://community.nianticspatial.com/t/how-can-i-use-semantic-segmentation-to-automatically-change-game-objects-per-channel/1806/2 "2022-04-08T21:12:41Z")

</div>

Hello Noriko,

To clarify, did you want different objects to spawn whenever you click a different channel? (sky, ground, etc.).

If so, you can follow the [Basic Semantics Tutorial](https://lightship.dev/docs/basic_querying_semantics_tutorial.html) to be able to identify the different channels in your scene. You can also refer to the [Basic Placement Tutorial](https://lightship.dev/docs/basic_placement_tutorial.html) for help with placing objects where you click.

To instantiate different objects based on which channel is clicked, you can create an array of Game Objects and assign each object in the Inspector. This will allow you to, for example, spawn a cube when the sky is clicked, a sphere when the ground is clicked, etc.

Please let me know if this helped solve your issue or if you would like further assistance.

---

<div class="post-metadata">

**Author:** ![Noriko\_Horie](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@Noriko\_Horie](https://community.nianticspatial.com/u/Noriko_Horie)\
**Post date:** [April 9, 2022, 12:15am UTC](https://community.nianticspatial.com/t/how-can-i-use-semantic-segmentation-to-automatically-change-game-objects-per-channel/1806/3 "2022-04-09T00:15:14Z")

</div>

Thank you for your reply.  
However, I have already been able to implement the solution you suggested myself.

[What we want to do]  
without having to click on the screen.  
Automatically recognizes multiple channels  
I want to switch channels automatically.

For example  
Without having to click on the screen

When the sky is recognized, a sphere appears

Next  
When the ground is recognized, a box appears.  
The sphere that appeared when the sky was recognized is then hidden.

Next.  
When the water surface is recognized, a cylinder appears.  
The box that appears when the ground is recognized is then hidden.

I would like to perform this action without having to click on the screen.

Please do so.

---

<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:** [April 11, 2022, 8:48pm UTC](https://community.nianticspatial.com/t/how-can-i-use-semantic-segmentation-to-automatically-change-game-objects-per-channel/1806/4 "2022-04-11T20:48:28Z")

</div>

Hello Noriko,

Thank you for the clarification.

One way to recognize each channel without clicking is to create ‘Tags’ and use the Raycast function to recognize which channel was hit. Please refer to the Unity Documentation for more information on [Tags](https://docs.unity3d.com/Manual/Tags.html) and [Raycasting](https://docs.unity3d.com/ScriptReference/Physics.Raycast.html).

Once you have that implemented, you can use ‘if statements’ so that certain Game Objects appear when certain channels are recognized. For instance, if “Sky” was recognized, you can set a cube to SetActive(true) to make it appear and then to SetActive(false) to make it disappear when a different channel is recognized. Please see the Unity Documentation [here](https://docs.unity3d.com/ScriptReference/GameObject.SetActive.html) for more information about using SetActive.

Please let me know if this helped. Thank you.

---

<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:** [April 14, 2022, 9:23pm UTC](https://community.nianticspatial.com/t/how-can-i-use-semantic-segmentation-to-automatically-change-game-objects-per-channel/1806/5 "2022-04-14T21:23:36Z")

</div>

Hello Noriko,

It’s been a few days since your last reply. Since we haven’t heard back, please open a new topic if you are still experiencing issues.

---

<div class="post-metadata">

**Author:** ![Noriko\_Horie](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@Noriko\_Horie](https://community.nianticspatial.com/u/Noriko_Horie)\
**Post date:** [April 17, 2022, 6:49am UTC](https://community.nianticspatial.com/t/how-can-i-use-semantic-segmentation-to-automatically-change-game-objects-per-channel/1806/6 "2022-04-17T06:49:34Z")

</div>

Thank you for your reply.

---

<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:50pm UTC](https://community.nianticspatial.com/t/how-can-i-use-semantic-segmentation-to-automatically-change-game-objects-per-channel/1806/7 "2026-03-05T23:50:13Z")

</div>

Age
