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

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.

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 to be able to identify the different channels in your scene. You can also refer to the Basic Placement Tutorial 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.

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.

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 and Raycasting.

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 for more information about using SetActive.

Please let me know if this helped. Thank you.

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.

Thank you for your reply.