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