Search Unity

Question Missing content/object placement options

Discussion in 'Unity MARS' started by Urchig, Jun 3, 2020.

  1. Urchig

    Urchig

    Joined:
    Jan 31, 2017
    Posts:
    4
    Is there a way place content with for expample a tap to place gesture? What would be the best way to implement here in MARS. At the moment content will place as soon as the conditions are met.
     
    Blarp likes this.
  2. unity_andrewm

    unity_andrewm

    Unity Technologies

    Joined:
    Jun 25, 2015
    Posts:
    73
    Our recommended method for this is to check for taps on a replicated proxy or visualized plane. The game sample does tap detection for maneuvering the robot character - you should be able to adapt that code for placing content. This isn't the first time we've had this request - we will be pulling that out into a separate template or prefab so there is a one-click answer.
     
  3. agpatel0007

    agpatel0007

    Joined:
    Aug 21, 2014
    Posts:
    14
    How do we get plane data ? something like AR foundation ( planewithpolygon)
     
  4. leweyg_unity

    leweyg_unity

    Unity Technologies

    Joined:
    Jan 29, 2020
    Posts:
    38
    Regarding how to get plane data, two main ways:

    - The "MARSPlaneVisualizer" if you want all the raw planes (add
    IUsesPlaneFinding, then call "
    this.SubscribePlaneAdded/Updated/Removed" to get callbacks). NOTE: not associated with a proxy.

    - The ShowChildrenInBoundsAction way (a Proxy Action behavior with IMatchVisibilityHandler, then add
    IUsesMARSTrackableData<MRPlane>, and call "
    var mrPlane = queryResult.ResolveValue(this);")

    Hope that helps!
    -Lewey G.
     
  5. amydigiov_Unity

    amydigiov_Unity

    Unity Technologies

    Joined:
    May 24, 2016
    Posts:
    16
    To follow up on @leweyg_unity 's reply, using IMatchVisibilityHandler is not necessary for this - the important interface is IUsesMARSTrackableData<MRPlane> which allows you to call ResolveValue(this) on a QueryResult.

    A good starting point would be to look at BuildSurfaceAction, which creates a mesh from plane data and can assign this mesh to a MeshCollider on the same game object. You can either copy this script and write a custom action out of it, or write a manager script that checks for taps on replicated Proxies with BuildSurfaceAction. If you have a reference to a Proxy that uses plane data you can get its current plane data by implementing IUsesMARSTrackableData<MRPlane> and using proxy.currentData.ResolveValue(this).
     
    wickedwaring and agpatel0007 like this.
  6. Blarp

    Blarp

    Joined:
    May 13, 2014
    Posts:
    270
    An object placement example would be nice.

    The Ikea-style ecommerce product placement is extremely important for people to adopt MARS.

    If you also worked in an asset streaming "Addressables" example ontop of that, we can have it to where people are streaming their 3d assets from their woocommerce wordpress installation. A lot of people would like to just update their products on their webserver, instead of rebuild their app everytime they get/change a product.

    Streaming an ecommerce 3d model from a webserver, into a unity app, to be placed on an AR plane in MARS; would be astronomical.

    Their 3d content would be hosted on their ecommerce cms, as well as streaming into their custom app built on Unity for AR.

    Google will be indexing 3d models from websites and placing them into the SERP here soon, so having these 3d assets hosted on the webserver will be extremely beneficial.
     
    Last edited: Jun 5, 2020
    cam415 likes this.
  7. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
    Blarp likes this.
  8. unity_andrewm

    unity_andrewm

    Unity Technologies

    Joined:
    Jun 25, 2015
    Posts:
    73
    Blarp likes this.
  9. KingEsmo

    KingEsmo

    Joined:
    Sep 22, 2013
    Posts:
    13
    @Blarp -_- thx for the virus you sent to my inbox luckily Im an IT expert and could've took matters into my own hands but its 2020 and two wrongs don't make a right so ill just report you. Stop trying to make an iPhone hacking program using unity. its sad.