Search Unity

Resolved ARKit support for iOS via Unity-ARKit-Plugin

Discussion in 'AR' started by jimmya, Jun 5, 2017.

Thread Status:
Not open for further replies.
  1. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    You need to make sure that any ARKit related gameObjects you load up have the DontDestroyOnLoad flag set.
     
  2. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    951
    This doesn't work. Runoptions has no option to keep existing anchors (only to remove them), and simply running 'RunWithConfig' again does absolutely nothing.

    IKEA does this. They generate a single plane (the floor) in advance, then everything is placed on that plane. Since several people have asked this question, maybe put the answer in the documentation? It's not obvious at all.

    Code that does nothing (except print to the console once it has found a plane):
    Code (csharp):
    1.  
    2. if (unityARAnchorManager.GetCurrentPlaneAnchors ().Count >= 1)
    3. {
    4.     Debug.Log ("Stop generation");
    5.     config.planeDetection = UnityARPlaneDetection.None;
    6.     config.getPointCloudData = false;
    7.     m_session.RunWithConfig(config);
    8. }
    9.  
     
    jimmya likes this.
  3. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    Last edited: Jan 8, 2018
    apaix likes this.
  4. christophergoy

    christophergoy

    Joined:
    Sep 16, 2015
    Posts:
    735
    Are you still getting this error? I haven't heard anyone else getting it. Are you up to date with all of your code/sdks/arkit plugin?
     
  5. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    This is exactly what I said (make config not detect planes, and make sure you don't use the removeexistinganchor in the runoptions).
     
  6. masslove

    masslove

    Joined:
    Apr 20, 2015
    Posts:
    1
    Hi, everyone!
    A question about facetracking - Working on animoji-like app for iPhoneX, I've noticed that, whenever the app catches any face in camera, it instantly interpretes it as some blendshape state, resulting in widefaced person gets permanently cheek-puffed avatar, largelipped guy's avatar always having his mouth slightly open, big-eyed person's eyes pop out immedeately), while original animoji always start from rather default mesh state, no matter what facial constitution. This leads to conclusion that some sort of calibration takes place there. Does such one exist in Unity ARKit plugin or is it possible to make one somehow? Is it some sort of computer vision or coefficient manipulations are enough? Like taking ARkit output coefficients for about half a second and setting their averaged value as true 0? Thanx, sorry for so many questions, I'm really excited by your plugin and it is real fun to explore its potential!
     
  7. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
  8. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
  9. Toolism

    Toolism

    Joined:
    Apr 10, 2014
    Posts:
    12
    Hey everyone! Does anyone know of a way (shader I'm assuming, or does one need to modify Unity somehow?) that would project these nice soft blurred shadows like in SnapChats Lens Studio?
    Link to a small video showcasing what I'm asking for :
     
  10. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    There is a shadow example in the plugin project - use https://docs.unity3d.com/Manual/ShadowOverview.html to tweak parameters to your needs.
     
  11. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
  12. Toolism

    Toolism

    Joined:
    Apr 10, 2014
    Posts:
    12
    Thanks for the reply jimmya:)
    I am aware of that page however please notice that there is nothing in there that lets you influence the blurryness of the shadow, penumbra etc. This is why I was asking if anyone is aware of how to set up unity for shadows like in the video.
     
  13. serge3k

    serge3k

    Joined:
    Jul 4, 2012
    Posts:
    1
    I have the same question.
     
  14. InfusedNL

    InfusedNL

    Joined:
    Mar 26, 2017
    Posts:
    2
    Hi guys,

    Can someone help me out? Unity Remote works partly as the Unity Game screen shows my iphone camera feed and also detects planes and shows the pointcloud particles.

    But on my phone it won't display these detected planes and pointcloud particles. Plus it also doesn't registrate touch events.
    So when I see a clickable area in the Unity Game screen it's no use touching my iPhone screen as nothing happens.
    I have a simple 3D model but it just won't show.

    I really appreciate any advice or tips, below are my specifications:

    • MacBook Pro 15" Retina - (Mid 2015)
    • xCode - Version 9.2 (9C40b)
    • Unity - Version 2017.3.0f3 Personal (64bit)
    • iPhone 7 - iOS 11.2.1 (15C153)
     
  15. Pilot-365

    Pilot-365

    Joined:
    Aug 9, 2017
    Posts:
    11
    Thanks for the reply Hawken. I modified the ARHitTest script to include the pinch-zoom script that you linked to. The script now successfully changes the Camera's Field of View according to the two touch zoom values. In the editor, I can see the FOV value's change, but this still doesn't affect my AR 3D object yet.

    Any ideas why my AR object in the scene is not affected by the camera's change in field of view?

    Many thanks for any help :)

    Code (JavaScript):
    1. float m_NewScale;
    2. float perspectiveZoomSpeed = 0.075f;     // Speed of the scale
    3.  
    4. // If there are two touches on the device...
    5. if (Input.touchCount == 2) {
    6.  
    7.      Debug.Log ("Touch Input = <color=red>2</color>");
    8.  
    9.      // Store both touches.
    10.      var touchZero = Input.GetTouch(0);
    11.      var touchOne = Input.GetTouch(1);
    12.  
    13.      // Find the position in the previous frame of each touch.
    14.      var touchZeroPrevPos = touchZero.position - touchZero.deltaPosition;
    15.      var touchOnePrevPos = touchOne.position - touchOne.deltaPosition;
    16.  
    17.      // Find the magnitude of the vector (the distance) between the touches in each frame.
    18.      var prevTouchDeltaMag = (touchZeroPrevPos - touchOnePrevPos).magnitude;
    19.      var touchDeltaMag = (touchZero.position - touchOne.position).magnitude;
    20.  
    21.      // Find the difference in the distances between each frame.
    22.      var deltaMagnitudeDiff = prevTouchDeltaMag - touchDeltaMag;
    23.  
    24.      m_NewScale = deltaMagnitudeDiff * perspectiveZoomSpeed;
    25.  
    26.      // Change the field of view based on the change in distance between the touches.
    27.      Camera.main.fieldOfView += m_NewScale;
    28.  
    29.      // Clamp the field of view to make sure it's between 1 and 120. (Current value, min, max)
    30.      Camera.main.fieldOfView = Mathf.Clamp (Camera.main.fieldOfView, 1f, 120f);
    31.  
    32.      // Prints the current field of view value
    33.      Debug.Log ("FOV = " + Camera.main.fieldOfView);
    34.  
    35. }
    SOLUTION AND UPDATE: Thanks to @jimmya for the tip on using an asset store plug-in for the scaling and rotation. Used LeanTouch and applied the LeanScale and LeanRotation scripts to my AR object's GameObject and now have fully working scale and rotation in ARKit using touch inputs and no sliders.
     
    Last edited: Jan 16, 2018
  16. Pilot-365

    Pilot-365

    Joined:
    Aug 9, 2017
    Posts:
    11
    Add a directional light to your AR scene and open it in the inspector. In the inspector you'll see an option to cast soft shadows as well as adjust the strength of the shadow. For the shadow to appear in your AR scene, add the "shadowPlanePrefab" to your 3D model in the scene (if you're using the example scene, this will also be know as the child of the "HitCubeParent"). Adjust the rotation and position of your direction light to get the desired shadow angle (in the case of your Snapchat example video, it will probably be at the position (0, 0, 0) and rotation (90, 0, 0)).
    LightSettings.png
    Hope this helps you
     
  17. effectzero

    effectzero

    Joined:
    Dec 20, 2012
    Posts:
    5
    Hey guys, heres my latest test using one of our games Beby characters:
    I combined my iPhoneX face capture test app with our Xsens full body suit using a DIY moCap helmet made from a paintball tactical helmet and goPro mount. capture results from iPhone X (face) & Xsens (body) are imported and rendered in Maya.

     
  18. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    Love it!
     
    effectzero likes this.
  19. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    You might want to look at starter tutorials to see how to move GameObjects etc: https://unity3d.com/learn/beginner-tutorials
     
    el_noobo likes this.
  20. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    Unity ARKit Remote is meant for you to be able to iterate on your ARKit app in the Editor, so all it does it sends ARKit data from the device to Editor (this is the only info that you cannot get directly from the Editor). For touch events, you will need to write code to detect mouse clicks in the Editor instead. E.g. See EditorHitTest.cs
     
  21. DigitalBeach

    DigitalBeach

    Joined:
    Jan 17, 2015
    Posts:
    37
    Is there a plan for exposing the ARFrame->captureDepthData from the Facekit tracking session when using the front camera AR stuff on iPhoneX?

    I hacked up ARSessionNative.mm and was able to see that the data in depthDataMap was valid and is a float32 buffer of 640x360 (or so I forgot to write it down). It also doesn't update every frame so you need to check if it is there.

    To make that usable, I would need to do all the plumbing to get that into the Unity side and scale it to match the camera feed and such. Just wanted to know if that was already in progress at Unity since they would be much better at that plumbing through the API than I am.
     
  22. cconsidi

    cconsidi

    Joined:
    Dec 7, 2017
    Posts:
    2
    Hi Everyone,

    I am working on using plane detection to place objects, and I use a prefab object to draw a rectangle on the detected plane. My question is when I have placed my model on the detected plane, how do I disable further plane detection and drawing on detected planes without removing my placed model?
     
  23. mobappexperts

    mobappexperts

    Joined:
    Aug 29, 2016
    Posts:
    7
    Check these two classes how I edited these classes to achieve this.

    Just activate GeneratePlanes to start detection planes and de-activate it to disable detection.


    Sorry forgot to attach file Anchor Manager ... Implemented two more functions to hide appeared planes if you need.
     

    Attached Files:

    Last edited: Jan 11, 2018
  24. InfusedNL

    InfusedNL

    Joined:
    Mar 26, 2017
    Posts:
    2
    Thanks for the quick response! In the file you pointed out there is a bit of code listening for a mouseclick input:

    - if (Input.GetMouseButtonDown (0))

    However when I test Unity remote on my phone and then do left mousebutton click on my computer on a plane that is detected nothing happens.

    My apologies if my questions may seem really simple to solve but I am still in college and unfortunately have to figure it out all on my own since we have no teachers (yet) that teach C# nor Unity. I do know a bit about programming since I also do webdesign but C# is still very new to me. So any directions are welcome.
     
  25. Yogesh_MV

    Yogesh_MV

    Joined:
    Dec 22, 2016
    Posts:
    5
    Terminating with uncaught exception of type Il2CppExceptionWrapper when using Arkit
    This is my scenario : I have imported Unity Arkit plugin from asset store. Now I am trying to load a new empty scene from FaceBlendshapeSloth scene. And getting the error below :

    libc++abi.dylib: terminating with uncaught exception of type Il2CppExceptionWrapper

    I have tried both these methods

    1. SceneManager.LoadScene(1);
    2. //AsyncOperation ao;
    3. //ao=SceneManager.LoadSceneAsync(1);
    I have added all required scenes in build setting.
     
  26. atcjavad

    atcjavad

    Joined:
    Jan 8, 2018
    Posts:
    14

    Hey bro
    I have a such as u problem in xcode
    I followed your order
    But i couldnt solve my problem
    Unity 2017.2
    Xcode 9.2
    iPhone 7
    and latest version ARkit plugin.
    Im seaching for couples of days how can i solve but i couldnt
    plz Help me
     
  27. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    See FAQ.
    specifically: You have probably changed the ProjectSettings asset distributed with the plugin and removed the PlayerSettings field for "Camera Usage Description" for the build. You need to put in some string in this field for ARKit to work.
     
  28. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    See FAQ - you probably have not enabled Face Tracking in the settings.
     
  29. atcjavad

    atcjavad

    Joined:
    Jan 8, 2018
    Posts:
    14
    I put some string in it , But it doesn’t work yet
     
  30. atcjavad

    atcjavad

    Joined:
    Jan 8, 2018
    Posts:
    14
    Hey Guys
    This is my problem
    My boundle Identifier name is ir.javad.yeganeh
    ----------------------------------------------------------------------------------------------------------------------------------------
    Ld /Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Products/ReleaseForRunning-iphoneos/yeganeh.app/yeganeh normal arm64
    cd /Users/javad/Desktop/good
    export IPHONEOS_DEPLOYMENT_TARGET=11.0
    export PATH="/Users/javad/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Users/javad/Desktop/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Users/javad/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Users/javad/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk -L/Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Products/ReleaseForRunning-iphoneos -L/Users/javad/Desktop/good -L/Users/javad/Desktop/good/Libraries -F/Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Products/ReleaseForRunning-iphoneos -filelist /Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Intermediates.noindex/Javad.build/ReleaseForRunning-iphoneos/Javad.build/Objects-normal/arm64/yeganeh.LinkFileList -Xlinker -map -Xlinker /Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Intermediates.noindex/Javad.build/ReleaseForRunning-iphoneos/Javad.build/yeganeh-LinkMap-normal-arm64.txt -miphoneos-version-min=11.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Intermediates.noindex/Javad.build/ReleaseForRunning-iphoneos/Javad.build/Objects-normal/arm64/yeganeh_lto.o -fembed-bitcode-marker -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -lc++ -weak_framework CoreMotion -weak-lSystem -framework Security -framework MediaToolbox -liPhone-lib -framework CoreText -framework AudioToolbox -weak_framework AVFoundation -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework CoreMedia -weak_framework CoreMotion -framework CoreVideo -framework Foundation -framework MediaPlayer -framework OpenAL -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework UIKit -liconv.2 -lil2cpp -weak_framework Metal -Xlinker -dependency_info -Xlinker /Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Intermediates.noindex/Javad.build/ReleaseForRunning-iphoneos/Javad.build/Objects-normal/arm64/yeganeh_dependency_info.dat -o /Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Products/ReleaseForRunning-iphoneos/yeganeh.app/yeganeh
    Undefined symbols for architecture arm64:
    "_OBJC_CLASS_$_ARWorldTrackingConfiguration", referenced from:
    objc-class-ref in ARSessionNative.o
    "_OBJC_CLASS_$_AROrientationTrackingConfiguration", referenced from:
    objc-class-ref in ARSessionNative.o
    "_OBJC_CLASS_$_ARAnchor", referenced from:
    objc-class-ref in ARSessionNative.o
    "_OBJC_CLASS_$_ARPlaneAnchor", referenced from:
    objc-class-ref in ARSessionNative.o
    "_OBJC_CLASS_$_ARSession", referenced from:
    objc-class-ref in ARSessionNative.o
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    "_OBJC_CLASS_$_ARWorldTrackingConfiguration", referenced from:
    objc-class-ref in ARSessionNative.o
    "_OBJC_CLASS_$_AROrientationTrackingConfiguration", referenced from:
    objc-class-ref in ARSessionNative.o
    "_OBJC_CLASS_$_ARAnchor", referenced from:
    objc-class-ref in ARSessionNative.o
    Showing All Errors Only
    : "_OBJC_CLASS_$_ARPlaneAnchor", referenced from:
    "_OBJC_CLASS_$_ARSession", referenced from:
    objc-class-ref in ARSessionNative.o
    Symbol(s) not found for architecture arm64
    Linker command failed with exit code 1 (use -v to see invocation)
    ------------------------------------------------------------------------------------------------
    I am using Xcode 9.2
    Unity 2017.2.0
    Latest ARKit plugin
    My Phone is IOS 11.2 , iPhone 7
    I dont have Mac , I am using VMWare workstation 12.5 , MacOs High Sierra
    ------------------------------------------------------------------------------------------------
    I can make a simple game in Unity then It will export in Xcode easily.
    But in ARkit game when i started , I just export a simple ARKit scene from the Unity then i faced to this problem in xcode.
    I made a simple AR game from the Xcode Without using Unity , It worked easily
    I Checked all of Questions and i tried to solve it , But i couldnt.
    I filled "Camera" by any String , I checked development in Player Setting , I checked artitechture , That was Universal.
    I checked all Part of StackFlow , Plz Dont refer to this Website
    I checked Unit FAQ , I couldnt find out what is my problem
    --------------------------------------------------------------------------------------------
    I am searching to solve my problem for couple of days , But i couldnt be succeesd
    pleeeeeeeeeeeeeeeeeeeeeeeeeeees Guide Me .
     
  31. atcjavad

    atcjavad

    Joined:
    Jan 8, 2018
    Posts:
    14
    Hey Guys
    This is my problem
    My boundle Identifier name is ir.javad.yeganeh
    ----------------------------------------------------------------------------------------------------------------------------------------
    Ld /Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Products/ReleaseForRunning-iphoneos/yeganeh.app/yeganeh normal arm64
    cd /Users/javad/Desktop/good
    export IPHONEOS_DEPLOYMENT_TARGET=11.0
    export PATH="/Users/javad/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Users/javad/Desktop/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Users/javad/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Users/javad/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk -L/Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Products/ReleaseForRunning-iphoneos -L/Users/javad/Desktop/good -L/Users/javad/Desktop/good/Libraries -F/Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Products/ReleaseForRunning-iphoneos -filelist /Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Intermediates.noindex/Javad.build/ReleaseForRunning-iphoneos/Javad.build/Objects-normal/arm64/yeganeh.LinkFileList -Xlinker -map -Xlinker /Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Intermediates.noindex/Javad.build/ReleaseForRunning-iphoneos/Javad.build/yeganeh-LinkMap-normal-arm64.txt -miphoneos-version-min=11.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Intermediates.noindex/Javad.build/ReleaseForRunning-iphoneos/Javad.build/Objects-normal/arm64/yeganeh_lto.o -fembed-bitcode-marker -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -lc++ -weak_framework CoreMotion -weak-lSystem -framework Security -framework MediaToolbox -liPhone-lib -framework CoreText -framework AudioToolbox -weak_framework AVFoundation -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework CoreMedia -weak_framework CoreMotion -framework CoreVideo -framework Foundation -framework MediaPlayer -framework OpenAL -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework UIKit -liconv.2 -lil2cpp -weak_framework Metal -Xlinker -dependency_info -Xlinker /Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Intermediates.noindex/Javad.build/ReleaseForRunning-iphoneos/Javad.build/Objects-normal/arm64/yeganeh_dependency_info.dat -o /Users/javad/Library/Developer/Xcode/DerivedData/Javad-dsnrpwmxeuwkajajwmvwnzuhnaib/Build/Products/ReleaseForRunning-iphoneos/yeganeh.app/yeganeh
    Undefined symbols for architecture arm64:
    "_OBJC_CLASS_$_ARWorldTrackingConfiguration", referenced from:
    objc-class-ref in ARSessionNative.o
    "_OBJC_CLASS_$_AROrientationTrackingConfiguration", referenced from:
    objc-class-ref in ARSessionNative.o
    "_OBJC_CLASS_$_ARAnchor", referenced from:
    objc-class-ref in ARSessionNative.o
    "_OBJC_CLASS_$_ARPlaneAnchor", referenced from:
    objc-class-ref in ARSessionNative.o
    "_OBJC_CLASS_$_ARSession", referenced from:
    objc-class-ref in ARSessionNative.o
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    "_OBJC_CLASS_$_ARWorldTrackingConfiguration", referenced from:
    objc-class-ref in ARSessionNative.o
    "_OBJC_CLASS_$_AROrientationTrackingConfiguration", referenced from:
    objc-class-ref in ARSessionNative.o
    "_OBJC_CLASS_$_ARAnchor", referenced from:
    objc-class-ref in ARSessionNative.o
    Showing All Errors Only
    : "_OBJC_CLASS_$_ARPlaneAnchor", referenced from:
    "_OBJC_CLASS_$_ARSession", referenced from:
    objc-class-ref in ARSessionNative.o
    Symbol(s) not found for architecture arm64
    Linker command failed with exit code 1 (use -v to see invocation)
    ------------------------------------------------------------------------------------------------
    I am using Xcode 9.2
    Unity 2017.2.0
    Latest ARKit plugin
    My Phone is IOS 11.2 , iPhone 7
    I dont have Mac , I am using VMWare workstation 12.5 , MacOs High Sierra
    ------------------------------------------------------------------------------------------------
    I can make a simple game in Unity then It will export in Xcode easily.
    But in ARkit game when i started , I just export a simple ARKit scene from the Unity then i faced to this problem in xcode.
    I made a simple AR game from the Xcode Without using Unity , It worked easily
    ------------------------------------------------------------------------------------------------
    I Checked all of Questions and i tried to solve it , But i couldnt.
    I filled "Camera" by any String , I checked development in Player Setting , I checked artitechture , That was Universal.
    I checked all Part of StackFlow , Plz Dont refer to this Website
    I changed Bitcode in xcode set to No , But i couldnt
    I changed valid artitecture in xcode , But i couldnt

    I checked Unit FAQ , I couldnt find out what is my problem
    --------------------------------------------------------------------------------------------
    I am searching to solve my problem for couple of days , But i couldnt be succeesd
    pleeeeeeeeeeeeeeeeeeeeeeeeeeees Guide Me .
     
  32. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    You did not mention VMWare before - we do not support that setup, and I have not tested on that. I have always recommended getting a Mac for iOS development - that is the only way to avoid these unnecessary headaches.

    From the error it sounds like you may be missing the ARKit.framework in the project? Possibly the BuildPostProcess script did not add it to your project?
     
  33. atcjavad

    atcjavad

    Joined:
    Jan 8, 2018
    Posts:
    14
    Thx bro
    I added Arkit. framework
    It worked well
     
  34. atcjavad

    atcjavad

    Joined:
    Jan 8, 2018
    Posts:
    14
    I
    I checked it
    That was Universal
    I am using vm ware workstation 14
    I dont have Mac book
    I dont know what shold i do
    Plz guide me
    ----------------------------
    xcode 9.2
    Unity 2017.2
    mac os high sierra
    latest ArKit Plugin
    ------------------------------
    Invalid iOS deployment version '-miphoneos-version-min=11.0', iOS 10 is the maximum deployment target for 32-bit targets
    -----------------------------
     
  35. jessevan

    jessevan

    Joined:
    Jan 3, 2017
    Posts:
    35
    Anyone else seeing this error in the latest build from the store?

    Assertion failed: Screen position out of view frustum (screen pos 0.000000, 0.000000, 30.000000) (Camera rect 0 0 1334 750)​

    I'm seeing the error in the editor in Unity 2017.2.0f3. Version 1.0.14 of the ARKit plugin in all the example scenes that I've tested.

    I see there are some related posts from a few months ago. It seems that @jimmya traced it back to an issue with the remote connection game object not being created, but it in these scenes.
     
    ina likes this.
  36. jessevan

    jessevan

    Joined:
    Jan 3, 2017
    Posts:
    35
    For some reason ` m_session.GetCameraProjection()` is coming back all zeros:

    0.00000 0.00000 0.00000 0.00000
    0.00000 0.00000 0.00000 0.00000
    0.00000 0.00000 0.00000 0.00000
    0.00000 0.00000 0.00000 0.00000
     
  37. titisriz

    titisriz

    Joined:
    Oct 8, 2015
    Posts:
    4
    i run arkit with unity 2017.2.0f3 and i need to put text before accessing arkit scene. When i run it in device, the first time i want to put my text in inputfield it was fine, but after i load the arkit scene and back to the previous one, the keyboard wont show up unless you hold the inputfield.

    If i change between scenes (not including the arkit scene) it was fine. and then i tried to put the inputfield in the arkit scene only and have the same problem. Is this error is arkit - related? or did i miss something?
     
  38. titisriz

    titisriz

    Joined:
    Oct 8, 2015
    Posts:
    4
    edit : apparently after i deleted touchmanager (touchscript plugin) from my arkit scene it worked
     
  39. waneta

    waneta

    Joined:
    Oct 10, 2015
    Posts:
    1
    2018-01-15 17:41:17.727970+0800 arkitscene[568:97616] [DYMTLInitPlatform] platform initialization successful



    2018-01-15 17:41:17.794861+0800 arkitscene[568:97402] -> registered mono modules 0x1032efbc0

    2018-01-15 17:41:23.642607+0800 arkitscene[568:97402] [Accessibility] ****************** Loading GAX Client Bundle ****************

    -> applicationDidFinishLaunching()

    Player data archive not found at `/var/containers/Bundle/Application/CFBEBE9D-6ED6-4895-BAF5-702C9979D6FC/arkitscene.app/Data/data.unity3d`, using local filesystem

    2018-01-15 17:41:24.120068+0800 arkitscene[568:97402] Metal GPU Frame Capture Enabled

    2018-01-15 17:41:24.121004+0800 arkitscene[568:97402] Metal API Validation Disabled

    2018-01-15 17:41:24.773462+0800 arkitscene[568:97402] [MC] Lazy loading NSBundle MobileCoreServices.framework

    2018-01-15 17:41:24.775526+0800 arkitscene[568:97402] [MC] Loaded MobileCoreServices.framework

    -> applicationDidBecomeActive()

    GfxDevice: creating device client; threaded=1

    Initializing Metal device caps: Apple A11 GPU

    Initialize engine version: 2017.2.0f3 (46dda1414e51)

    =================================================================

    Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]

    PID: 568, TID: 97628, Thread name: (none), Queue name: NSOperationQueue 0x1d003d600 (QOS: UNSPECIFIED), QoS: 0

    Backtrace:

    4 arkitscene 0x0000000102610848 UnityCurrentOrientation + 60

    5 arkitscene 0x00000001025fe0c4 __UnityCoreMotionStart_block_invoke + 108

    6 Foundation 0x00000001838a9ba0 <redacted> + 16

    7 Foundation 0x00000001837e9894 <redacted> + 72

    8 Foundation 0x00000001837d94c4 <redacted> + 848

    9 libdispatch.dylib 0x000000018284ea14 <redacted> + 16

    10 libdispatch.dylib 0x000000018288a9c4 <redacted> + 280

    11 libdispatch.dylib 0x000000018284ea14 <redacted> + 16

    12 libdispatch.dylib 0x000000018288a9c4 <redacted> + 280

    13 libdispatch.dylib 0x000000018288a878 <redacted> + 104

    14 Foundation 0x00000001838ab878 <redacted> + 376

    15 libdispatch.dylib 0x000000018284ea14 <redacted> + 16

    16 libdispatch.dylib 0x000000018288b640 <redacted> + 420

    17 libdispatch.dylib 0x000000018288a09c <redacted> + 776

    18 libdispatch.dylib 0x00000001828902a4 <redacted> + 568

    19 libdispatch.dylib 0x0000000182890008 <redacted> + 112

    20 libsystem_pthread.dylib 0x0000000182af706c _pthread_wqthread + 1268

    21 libsystem_pthread.dylib 0x0000000182af6b6c start_wqthread + 4

    2018-01-15 17:41:27.037962+0800 arkitscene[568:97628] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]

    PID: 568, TID: 97628, Thread name: (none), Queue name: NSOperationQueue 0x1d003d600 (QOS: UNSPECIFIED), QoS: 0

    Backtrace:

    4 arkitscene 0x0000000102610848 UnityCurrentOrientation + 60

    5 arkitscene 0x00000001025fe0c4 __UnityCoreMotionStart_block_invoke + 108

    6 Foundation 0x00000001838a9ba0 <redacted> + 16

    7 Foundation 0x00000001837e9894 <redacted> + 72

    8 Foundation 0x00000001837d94c4 <redacted> + 848

    9 libdispatch.dylib 0x000000018284ea14 <redacted> + 16

    10 libdispatch.dylib 0x000000018288a9c4 <redacted> + 280

    11 libdispatch.dylib 0x000000018284ea14 <redacted> + 16

    12 libdispatch.dylib 0x000000018288a9c4 <redacted> + 280

    13 libdispatch.dylib 0x000000018288a878 <redacted> + 104

    14 Foundation 0x00000001838ab878 <redacted> + 376

    15 libdispatch.dylib 0x000000018284ea14 <redacted> + 16

    16 libdispatch.dylib 0x000000018288b640 <redacted> + 420

    17 libdispatch.dylib 0x000000018288a09c <redacted> + 776

    18 libdispatch.dylib 0x00000001828902a4 <redacted> + 568

    19 libdispatch.dylib 0x0000000182890008 <redacted> + 112

    20 libsystem_pthread.dylib 0x0000000182af706c _pthread_wqthread + 1268

    21 libsystem_pthread.dylib 0x0000000182af6b6c start_wqthread + 4

    Setting up 1 worker threads for Enlighten.

    Thread -> id: 16ed23000 -> priority: 1

    UnloadTime: 0.825541 ms

    2018-01-15 17:41:29.086681+0800 arkitscene[568:97402] Uncaught exception: UnityARKitPluginFaceTrackingNotEnabled: UnityARKitPlugin: Checking FaceTracking device support without enabling it in settings.

    (

    0 CoreFoundation 0x0000000182ed237c <redacted> + 148

    1 libobjc.A.dylib 0x0000000182118528 objc_exception_throw + 56

    2 CoreFoundation 0x0000000182ed22ac <redacted> + 0

    3 arkitscene 0x000000010299959c IsARKitFaceTrackingConfigurationSupported + 44

    4 arkitscene 0x000000010261d48c UnityARFaceAnchorManager_Start_m776631792 + 180

    5 arkitscene 0x0000000102971460 _Z31RuntimeInvoker_Void_t1841601450PFvvEPK10MethodInfoPvPS4_ + 20

    6 arkitscene 0x0000000103209384 _ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException + 68

    7 arkitscene 0x0000000102c4ddc8 _Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb + 100

    8 arkitscene 0x0000000102c54cdc _ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb + 60

    9 arkitscene 0x0000000102c59c4c _ZN13MonoBehaviour30InvokeMethodOrCoroutineCheckedE18ScriptingMethodPtr18ScriptingObjectPtrP21ScriptingExceptionPtr + 1180

    10 arkitscene 0x0000000102c59e58 _ZN13MonoBehaviour30InvokeMethodOrCoroutineCheckedE18ScriptingMethodPtr18ScriptingObjectPtr + 84

    11 arkitscene 0x0000000102c59078 _ZN13MonoBehaviour16DelayedStartCallEP6ObjectPv + 80

    12 arkitscene 0x0000000102ad9bc0 _ZN18DelayedCallManager6UpdateEi + 676

    13 arkitscene 0x0000000102b8b7ec _Z10PlayerLoopv + 464

    14 arkitscene 0x00000001029d92d0 _ZL19UnityPlayerLoopImplb + 36

    15 arkitscene 0x0000000102601c64 UnityRepaint + 140

    16 arkitscene 0x0000000102601b50 -[UnityAppController(Rendering) repaintDisplayLink] + 88

    17 GPUToolsCore 0x0000000104ff8254 -[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 176

    18 QuartzCore 0x0000000186dff710 <redacted> + 672

    19 QuartzCore 0x0000000186eb3c5c <redacted> + 240

    20 CoreFoundation 0x0000000182e60290 <redacted> + 188

    21 CoreFoundation 0x0000000182e7b000 <redacted> + 56

    22 CoreFoundation 0x0000000182e7a704 <redacted> + 440

    23 CoreFoundation 0x0000000182e781d8 <redacted> + 2196

    24 CoreFoundation 0x0000000182d97e58 CFRunLoopRunSpecific + 436

    25 GraphicsServices 0x0000000184c44f84 GSEventRunModal + 100

    26 UIKit 0x000000018c4ec67c UIApplicationMain + 236

    27 arkitscene 0x00000001025fab00 main + 160

    28 libdyld.dylib 0x00000001828b456c <redacted> + 4

    )

    2018-01-15 17:41:29.087210+0800 arkitscene[568:97402] *** Terminating app due to uncaught exception 'UnityARKitPluginFaceTrackingNotEnabled', reason: 'UnityARKitPlugin: Checking FaceTracking device support without enabling it in settings.'

    *** First throw call stack:

    (0x182ed2364 0x182118528 0x182ed22ac 0x10299959c 0x10261d48c 0x102971460 0x103209384 0x102c4ddc8 0x102c54cdc 0x102c59c4c 0x102c59e58 0x102c59078 0x102ad9bc0 0x102b8b7ec 0x1029d92d0 0x102601c64 0x102601b50 0x104ff8254 0x186dff710 0x186eb3c5c 0x182e60290 0x182e7b000 0x182e7a704 0x182e781d8 0x182d97e58 0x184c44f84 0x18c4ec67c 0x1025fab00 0x1828b456c)

    libc++abi.dylib: terminating with uncaught exception of type NSException

    (lldb)
     
  40. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    I have a camera in my scene which is being used as the AR camera, I also have another camera in my scene which is being fed the exact same transforms, so it can render some other things, it works in the editor but when building to the phone, it creates a slight visual offset between the two cameras, even though they are getting the same transform information and occupying the same place.

    The AR camera has clear flags solid color, the other camera has Don't clear.

    I'm kind of puzzled as to why this is happening...
     
  41. rosssssss

    rosssssss

    Joined:
    Jan 27, 2017
    Posts:
    70
    Hey folks,
    Just downloaded the ARKit asset and I can't get any of the demos to work. There is never a feed showing on the iPhone (nor on the editor using the ARKitRemote.)
    It's an iPhone 7 running iOS 11.2.2 -
    and Unity 2017.3.0f3

    Also (not sure if it's related) I'm getting an error constantly from ARCameraManager - line 81
    m_camera.projectionMatrix = m_session.GetCameraProjection ();
    if i leave this line uncommented then it'll constantly give the error -
    Screen position out of view frustum (screen pos 0.000000, 0.000000, 30.000000) (Camera rect 0 0 1896 870)
    in the editor and in the Xcode log.

    Something I'm missing?
    Thanks
     
  42. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    if you're using ios 11 target, you should set it to arm64 architecture instead of universal.
     
  43. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    See FAQ about "UnityARKitPlugin: Checking FaceTracking device support without enabling it in settings.'"
     
  44. titisriz

    titisriz

    Joined:
    Oct 8, 2015
    Posts:
    4
    hello again, can anyone give me a clue how to show the tracking process in percentage like ar dragon app?
    ive been searching on the api but i only found the tracking state and state reason, but i want to show the actual progress of the tracking. What kind of approach are they using?
     
    Last edited: Jan 16, 2018
  45. erikwp

    erikwp

    Joined:
    Jan 16, 2018
    Posts:
    25
    I am getting the same issue. I have tried the solutions suggested earlier but the problem persists. I have UnityARKitRemote running on my ipad and everything looks to be running fine. On the unity side I connect to player as instructed but I see only a black (or green) screen when "Start remote ARKit Session" button is pressed. And the frustum error. When the unity app is running the ios side says "Waiting for editor connection" but on the Unity side says "Connected to ARKit Remote device : 65262". Using the newest build available on Asset store.
     
    Last edited: Jan 16, 2018
  46. erikwp

    erikwp

    Joined:
    Jan 16, 2018
    Posts:
    25
    SOLVED - I realized the answer was aready given earlier in the forum. Simply add this code to the Start function:

    Code (CSharp):
    1.         UnityARCamera scamera = new UnityARCamera ();
    2.         scamera.worldTransform = new UnityARMatrix4x4 (new Vector4 (1, 0, 0, 0), new Vector4 (0, 1, 0, 0), new Vector4 (0, 0, 1, 0), new Vector4 (0, 0, 0, 1));
    3.         Matrix4x4 projMat = Matrix4x4.Perspective (60.0f, 1.33f, 0.1f, 30.0f);
    4.         scamera.projectionMatrix = new UnityARMatrix4x4 (projMat.GetColumn(0),projMat.GetColumn(1),projMat.GetColumn(2),projMat.GetColumn(3));
    5.         UnityARSessionNativeInterface.SetStaticCamera (scamera);
    6.  
    But now I am only seeing video taken by my desktop camera and not my ios device. I switched to the correct player device in the Console window but nothing happens. How do I switch input video source?
     
    Last edited: Jan 16, 2018
  47. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Hi,
    Can someone please tell me how I can click on a plane and delete its anchor and plane and also get it's id, as I'm struggling to find the answer, I use the code below to turn on / off plane detection and all that works fine, but what I'd like to do is if there are more than 1 plane in the scene I want to click on the ones I don't want and delete them, thanks.

    Code (CSharp):
    1. using System;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using System.Runtime.InteropServices;
    5. using UnityEngine;
    6. using UnityEngine.UI;
    7. using UnityARInterface;
    8. using UnityEngine.XR.iOS;
    9.  
    10. namespace UnityARInterface
    11. {
    12.     public class DeletePlanesAR : MonoBehaviour
    13.     {
    14.         public bool resetTracking;
    15.         public bool removeExistingAnchors;
    16.  
    17.         public LayerMask myLayerMask;
    18.  
    19.         public List< ARHitTestResult > hitResults = new List< ARHitTestResult >();
    20.  
    21.         private Ray ray;
    22.         private Camera camera;
    23.         private RaycastHit rayHit;
    24.  
    25.         private Text UI_InformationPanel;
    26.         private UnityARSessionNativeInterface nativeInterface
    27.         { get { return UnityARSessionNativeInterface.GetARSessionNativeInterface(); } }
    28.  
    29.         //              ----------------------------
    30.         void Start ()
    31.         {
    32.             camera = Camera.main;
    33.             UI_InformationPanel = GameObject.Find("Information Panel").GetComponent< Text >();
    34.         }
    35.         //              ----------------------------
    36.         void Update ()
    37.         {
    38.             if ((Input.GetMouseButtonDown(0)))
    39.             {
    40.                 ray = camera.ScreenPointToRay(Input.mousePosition);
    41.  
    42.                 if (Physics.Raycast(ray, out rayHit, float.MaxValue, myLayerMask))
    43.                 {
    44.                     var screenPosition = Camera.main.ScreenToViewportPoint(Input.mousePosition);
    45.                     ARPoint point = new ARPoint {
    46.                         x = screenPosition.x,
    47.                         y = screenPosition.y
    48.                     };
    49.                     // prioritize reults types
    50.                     ARHitTestResultType[] resultTypes = {
    51.                         ARHitTestResultType.ARHitTestResultTypeFeaturePoint,
    52.                         ARHitTestResultType.ARHitTestResultTypeExistingPlane,
    53.                         ARHitTestResultType.ARHitTestResultTypeHorizontalPlane,
    54.                         ARHitTestResultType.ARHitTestResultTypeExistingPlaneUsingExtent
    55.                     };
    56.  
    57.                     foreach (ARHitTestResultType resultType in resultTypes)
    58.                     {
    59.                         if (HitTestWithResultType (point, resultType))
    60.                         {
    61.                             return;
    62.                         }
    63.                     }
    64.                 }
    65.             }
    66.         }
    67.         //              ----------------------------
    68.         public void StartPlaneGeneration ()
    69.         {
    70.             ARKitWorldTrackingSessionConfiguration sessionConfig = new ARKitWorldTrackingSessionConfiguration(
    71.                 UnityARAlignment.UnityARAlignmentGravity,
    72.                 UnityARPlaneDetection.Horizontal,
    73.                 false,
    74.                 true
    75.             );
    76.             UnityARSessionRunOption roAnchors = false ? UnityARSessionRunOption.ARSessionRunOptionRemoveExistingAnchors : 0;
    77.             UnityARSessionRunOption roTracking = false ? UnityARSessionRunOption.ARSessionRunOptionResetTracking : 0;
    78.  
    79.             UnityARSessionRunOption runOptions =
    80.                 roAnchors |
    81.                 roTracking;
    82.  
    83.             nativeInterface.RunWithConfigAndOptions(
    84.                 sessionConfig, runOptions);
    85.  
    86.             UI_InformationPanel.text = "Started Plane Generation ..";
    87.         }
    88.         //              ----------------------------
    89.         public void StopPlaneGeneration ()
    90.         {
    91.             ARKitWorldTrackingSessionConfiguration sessionConfig = new ARKitWorldTrackingSessionConfiguration(
    92.                 UnityARAlignment.UnityARAlignmentGravity,
    93.                 UnityARPlaneDetection.None,
    94.                 false,
    95.                 true
    96.             );
    97.             UnityARSessionRunOption roAnchors = false ? UnityARSessionRunOption.ARSessionRunOptionRemoveExistingAnchors : 0;
    98.             UnityARSessionRunOption roTracking = false ? UnityARSessionRunOption.ARSessionRunOptionResetTracking : 0;
    99.  
    100.             UnityARSessionRunOption runOptions =
    101.                 roAnchors |
    102.                 roTracking;
    103.  
    104.             nativeInterface.RunWithConfigAndOptions(
    105.                 sessionConfig, runOptions);
    106.  
    107.             UI_InformationPanel.text = "Stoped Plane Generation ..";
    108.         }
    109.         //              ----------------------------
    110.         public void QuitApplication ()
    111.         {
    112.             Application.Quit();
    113.         }
    114.         //              ----------------------------
    115.         bool HitTestWithResultType (ARPoint point, ARHitTestResultType resultTypes)
    116.         {
    117.             hitResults = UnityARSessionNativeInterface.GetARSessionNativeInterface ().HitTest (point, resultTypes);
    118.  
    119.             if (hitResults.Count > 0)
    120.             {
    121.                 foreach (var hitResult in hitResults)
    122.                 {
    123.                     UI_InformationPanel.text = "Removing anchor ..";
    124.                     UnityARSessionNativeInterface.GetARSessionNativeInterface().RemoveUserAnchor("0");
    125.                     return true;
    126.                 }
    127.             }
    128.             return false;
    129.         }
    130.         //              ----------------------------
    131.     }
    132. }
     
  48. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    Are you just trying to build and run the demos on the phone? The screen position out of view frustum spew is harmless. But could you send me any other things that are printing out on the XCode log?
     
  49. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    They are just faking it - they probably know around how long it takes to get a tracked plane, or figuring out how many features points you have found and use that to indicate progress.
     
  50. jimmya

    jimmya

    Joined:
    Nov 15, 2016
    Posts:
    793
    This spew on the console is harmless - the camera projection matrix is set to all zeros before ARKit is initialized and returns correct values for the camera projection matrix. I'll fix it soon.

    EDIT: fixed in bitbucket
     
    Last edited: Jan 16, 2018
    jessevan likes this.
Thread Status:
Not open for further replies.