Search Unity

Resolved How to Convert Mars Plane Visualizer Data into Collider Planes?

Discussion in 'Unity MARS' started by Corfu, Jul 24, 2020.

  1. Corfu

    Corfu

    Joined:
    Feb 26, 2018
    Posts:
    16
    Hello,

    Please if anyone has any help in what components to add to convert Mars Plane Visualizer data into collider planes so I can bounce objects off of the scanned ground/tables/chairs etc.

    Thank you in advance for any help!
     
  2. leweyg_unity

    leweyg_unity

    Unity Technologies

    Joined:
    Jan 29, 2020
    Posts:
    38
    You should be able to add a MeshCollider to your plane prefab, and the Plane Visualizer will pick that up and ensure it is updated.
     
    Corfu likes this.
  3. Corfu

    Corfu

    Joined:
    Feb 26, 2018
    Posts:
    16
    Thank you for your help! Yes that seems to work (but using a box collider with a prefab Horizontal plane) one plane at a time, I was wondering if there is a way to make every small surface the Plane Visualizer detects immediately a collision surface? Thank you again!
     
  4. CiaranWills

    CiaranWills

    Unity Technologies

    Joined:
    Apr 24, 2020
    Posts:
    199
    If you want to make a collider for every detected plane, you can use a Proxy Replicator and on the child Proxy Object add the plane condition, the Build Surface action (you need to remove Set Pose first) and add a Mesh Collider. This will instantiate a proxy with a collider for each detected surface.

    It's super fun to be able to do physics on real world surfaces ;)
     
    Corfu likes this.
  5. leweyg_unity

    leweyg_unity

    Unity Technologies

    Joined:
    Jan 29, 2020
    Posts:
    38
    Also please use the MeshCollider not BoxCollider (very different, as the AR planes are meshes not boxes).
     
    Corfu likes this.
  6. Corfu

    Corfu

    Joined:
    Feb 26, 2018
    Posts:
    16
    Awesome! Thank you so much for your help! I really appreciate the time and consideration you put in to address these noob questions!
     
  7. Corfu

    Corfu

    Joined:
    Feb 26, 2018
    Posts:
    16
    Thank you for your insights and help! Really appreciated!