Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Example to create a semantic tag

Discussion in 'Unity MARS' started by ikdd88, Jul 20, 2020.

  1. ikdd88

    ikdd88

    Joined:
    Apr 6, 2020
    Posts:
    6
    Hi,

    Is it possible to have an example of how to create a new semantic tag? I would like to have a semantic tag for tables for example and it's not clear from the development guide how to achieve this.

    Thank you.
     
  2. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
    Hey There,

    To add a semantic tag condition to your proxies just clock on the "Add MARS Component" button and add the tag, then create just assign a name to it.

    Screen Shot 2020-07-21 at 1.48.02 PM.png
     
  3. ikdd88

    ikdd88

    Joined:
    Apr 6, 2020
    Posts:
    6
    Then I would need to create my own trait that defines a table and use the semantic tag with the trait name?
    I was using the height above floor condition + plane size condition to filter tables in the scene and wanted to then assign a semantic tag to those.
     
  4. ikdd88

    ikdd88

    Joined:
    Apr 6, 2020
    Posts:
    6
    I was trying to create a multicondition so that I have both the HeightAboveFloorCondition and PlaneSizeCondition satisfied and then I would want to create a semantic tag in that case. Would this be the way to do this? And if so, I'm having trouble understanding how those MARS given conditions can be used as subconditions. I was looking into the FlatFloorCondition as an example but didn't manage to translate this into using HeightAboveFloorCondition and PlaneSizeCondition as subconditions. I would appreciate some help.
     
  5. leweyg_unity

    leweyg_unity

    Unity Technologies

    Joined:
    Jan 29, 2020
    Posts:
    38
    To define your own data objects and semantics, you can use "SynthesizedSemanticTag" to create a new data object and associated a tag with it. If you know the data ID of the item you want to add a trait to, you can also use "AddOrUpdateTrait" which comes with "IProvidesTraits"
     
  6. unity_andrewm

    unity_andrewm

    Unity Technologies

    Joined:
    Jun 25, 2015
    Posts:
    73
    Hi Cdorik,

    We're have a more elegant way to add semantic tags via proxies on the way. In the mean time - if you're looking to essentially define a proxy once to use across multiple objects, I would recommend you put your proxy definition within a prefab.