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

ARKit never generated plane, never got hit

Discussion in 'AR' started by bboydaisuke, Oct 16, 2017.

  1. bboydaisuke

    bboydaisuke

    Joined:
    Jun 14, 2014
    Posts:
    67
    I spend whole day with ARKit but nothing I got. The app runs on iPhone 6s with iOS 11.0.3. However the app shows only camera image and cube with checker mark. Tap everywhere but nothing happens. I assume it never generate plane in my environment while it generates lots of particle stars.
    My troubleshooting steps:
    1. Set up an app with UnityARKitRemote scene on iPhone and run. It is development build.
    2. Open EditorTestScene in editor, run, and connect to iPhonePlayer. I see picture captured by iPhone camera in Game view.
    3. Move iPhone to find somewhere flat. I see a lot of yellow particle stars. I see "ParticlePrefab(Clone)" in Hierarchy view. I don't see any "debugPlanePrefab" in Hierarchy view.
    4. By the way, I tweaked EditorHitTest.cs as follows:
      Code (CSharp):
      1. if (Physics.Raycast (ray, out hit, maxRayDistance, collisionLayerMask)) {
      2.     //we're going to get the position from the contact point
      3.     m_HitTransform.position = hit.point;
      4.     Debug.Log (string.Format ("x:{0:0.######} y:{1:0.######} z:{2:0.######}", m_HitTransform.position.x,      m_HitTransform.position.y, m_HitTransform.position.z));
      5.  
      6.     //and the rotation from the transform of the plane collider
      7.     m_HitTransform.rotation = hit.transform.rotation;
      8. } else {
      9.     Debug.Log ("no hit.");      // ------ let me know if it didn't hit ------
      10. }
    5. Click everywhere in Game view. Especially, around stars.
    6. As a result, I only see a lot of "no hit." in console.
    I looked through several articles and watched several tutorial videos but I didn't find anything wrong in my project. I expected UnityARGeneratePlane places planes with collider when it find somewhere flat and planes got hit.
    However, I never seen UnityARGeneratePlane generates debugPlanePrefab.

    Please advise me to get it work.

    Environment:
    • macOS Sierra 10.12.6
    • Unity 2017.1.2f1
    • Unity AR Kit as of 11th, Oct, 2017 (latest commit hash: c752c0c3c5f7e1e5c80a896e7afd66b21b8874b1)
    • iPhone 6s
    • iOS 11.0.3