Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

ARKit support for iOS via Unity-ARKit-Plugin

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

  1. kweiming

    kweiming

    Joined:
    Jun 18, 2017
    Posts:
    9
    Hi everyone,
    I have zero experience on developing an iOS app.
    I'm now finish my project and I want to share with a group of people
    Does anyone know is it possible to download it through QRcode or sth?
    or the only way to download it is from the App store?

    thanks
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,192
    Your options are to either release it to everyone via the App Store, or distribute it to specific people via TestFlight.
     
    kweiming likes this.
  3. mlnczk

    mlnczk

    Joined:
    May 12, 2017
    Posts:
    10
    Thanks a lot ! That was the solution. Finally I got my hands on blueboxes and managed to program what I wanted :) Now im working on occlusion to add to my walls. Anyways thanks !
     
  4. mlnczk

    mlnczk

    Joined:
    May 12, 2017
    Posts:
    10
    Hi! Thanks for replaying. What do you mean by virtual walls? Im putting on detected planes my own planes that are just normal objects. I was trying to add occlusion to them but didn't manage to achieve proper occlusion. Can you be more specific ?
     
  5. Kevin__h

    Kevin__h

    Joined:
    Nov 16, 2015
    Posts:
    38
    With virtual walls I actually meant exactly what you're doing. Have you tried with cubes instead of planes. Planes can only be viewed straight on or on a slight angle due to the normals, hence why the occlusion can only happen straight on or on sleight angles. Or do planes not give occlusion at all? (please define proper occlusion, do you get some sort of occlusion or none at all?)
     
  6. Kevin__h

    Kevin__h

    Joined:
    Nov 16, 2015
    Posts:
    38
    Also make sure to check your rendering queue, if the AR prefab's material's rendering queue is higher than that of your virtual walls, the AR prefab will always be visible.
     
  7. akhella

    akhella

    Joined:
    Apr 14, 2015
    Posts:
    9
    I am having a problem with ARKit Remote crashing on the iOS device as soon as I hit play in Unity, and select "Start Remote ARKit Session" in the scene. This happens on both iPhone 7 and iPad Pro.

    I am using the latest bits from BitBucket with Unity 2017.3.1f1 and XCode 9.3

    I've set the iOS target to 11.3, and compiled ARKit Remote as development build.

    Anyone else facing the same problem and was able to solve it?

    Thanks!

    EDIT: I just tried other scenes with the same configuration, and they all crash on start
     
    Last edited: Apr 18, 2018
  8. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    Looks like you have a null reference in your ARpaint.PaintManager.ARFrameUpdated method. Check what variables you're using there and why it might be null. Otherwise, post the code for that method and we can take a look.
     
  9. vinay_vidhani

    vinay_vidhani

    Joined:
    Oct 27, 2016
    Posts:
    9
    @jimmya I placed object in scene and then I moved little far from the model (let say 10 feet from 3d object position) and when I come back to the model, It changed its position(drifted). How can we solve this problem? Sorry If my question is bad.
     
  10. Kevin__h

    Kevin__h

    Joined:
    Nov 16, 2015
    Posts:
    38
    Make sure enough planes are detected before placing the object, move slowly, look for a good lit environment and don't point your camera at a plain surface. There isn't much you can do about it software wise, drifting happens because ARKit loses tracking, but that can have a number of reasons.
     
  11. vinay_vidhani

    vinay_vidhani

    Joined:
    Oct 27, 2016
    Posts:
    9
    I am moving slowly but still this is happening what can we do with this issue.
     
  12. MSFX

    MSFX

    Joined:
    Sep 3, 2009
    Posts:
    111
    I'm still getting this error... I can't be the only one getting this surely?? iPhone 6S, 11.3, Unity 2017.4.1f1, latest ARKit sdk
    Literally crashes on launch, help!!
     

    Attached Files:

  13. Kevin__h

    Kevin__h

    Joined:
    Nov 16, 2015
    Posts:
    38
    But are you waiting for enough planes to be detected? Is the environment lit up enough? And do your surfaces have some texture, some recognisable points? Or are they just blank walls? Moving slowly is often doesn't matter too much as long as you don't move so fast that your images get blurry. But all these other factors play a bigger role in proper tracking.
     
  14. vinay_vidhani

    vinay_vidhani

    Joined:
    Oct 27, 2016
    Posts:
    9
    As I am moving my device, planes are keep detecting and I am using my application onto grass. My main object is flag and I am putting balls around the flag and calculating distance between respective ball. Though for balls planes are detecting, tracking is also stating NORMAL but the main thing is when I am going back to flag then I can see flag's position has been changed. I am also logging flag's position by using transform.position, is still same however.
     
  15. WagDan

    WagDan

    Joined:
    Nov 7, 2014
    Posts:
    36
    Hello everyone - i've read quite a bit of this forum but have seen no mention of the Unity AR Package...
    @jimmya thanks again for your pioneering work! Do you have a release date scheduled for the AR Package?

    i watched your GDC video 3 times and am super eager to get your package!
     
  16. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    This was fixed some time ago - you might want to check whether you have latest plugin.
     
  17. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    826
    any update?
     
  18. JelmerV

    JelmerV

    Joined:
    Nov 29, 2012
    Posts:
    180
    Hmm is the light estimation broken? I only seem to get a 0 for both camera.lightData.arLightEstimate.ambientIntensity and camera.lightData.arLightEstimate.ambientColorTemperature.

    The scene is dark, and I added a line for debugging in an otherwise unaltered UnityARAmbient.cs
    Not sure where I can see the version, but I downloaded the ARKit 1.5 from bitbucket today.
     
  19. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    Ok, here's the deal. This was not how it was working before, but it is how it works now: It appears that when a face goes out of the screen, the face anchor does not get removed automatically, but the face stops getting tracked. There is a Trackable protocol on the anchors (which we have not exposed in Unity plugin so far), which lets you know when the face is not tracked any more. You can remove the face anchor yourself by calling RemoveUserAnchor - which despite the name can remove any kind of anchor.
     
    ina likes this.
  20. purplehaze90

    purplehaze90

    Joined:
    Feb 3, 2017
    Posts:
    13
    Hello, I am using Unity 2017.2.0f3. I am having issues with the ARKitRemoteConnection. I had tried this a couple of months back and I was able to debug applications on my Editor. But, since the past week , the remote connection is refusing to let me connect the editor to the device camera. On pushing the Start Remote ARKit Session, nothing happens at all. This issue is also happening with Unity v2017.4. What steps should I take to troubleshoot this and get back to using the ARKit remote for debugging. I am using an iPhone SE and have also updated to the latest version of ARKitRemote plugin
     

    Attached Files:

    Boyka2yori likes this.
  21. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    826
    Eh, "not exposed in Unity plugin so far" - I assume this will make it to the bitbucket update very soon?
     
  22. mlnczk

    mlnczk

    Joined:
    May 12, 2017
    Posts:
    10
    Guys you got any idea about occlusion how to put my virtual objects behind real ones? I setup occlusion culling with camera, tasted Occlusion Area with my objects, im setting them static whenever I accept their position in real world with button I created. But problem is with baking. Since I need to be able to move dynamically my virtual objects I can't bake them before starting application and while running it seems you can't force baking in Unity.
     
  23. rpeer

    rpeer

    Joined:
    Nov 19, 2017
    Posts:
    4



    Chris,
    I am trying to instantiate a gameobject to an ARpoint using Unity coordinates before reading the scene, is it possible to create a placeholder ARpoint OR use lat/long to place the point more accurately, currently the instantiated objects just float a constant distance from the camera and are not grounded in 3D space.

    I have been trying to get this to work for a while, any input would be helpful.
     
  24. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    There is an example that shows occlusion in the plugin.
     
  25. antoniognt

    antoniognt

    Joined:
    Jan 14, 2017
    Posts:
    1
    Hi Guys, I'd like to look at the reflections of ambient light on my 3D models in real-time by ARKit, wherever I want it ... Is it possible to create a texture in real time for cubemap ? txxx
     
  26. Fl0oW

    Fl0oW

    Joined:
    Apr 24, 2017
    Posts:
    19
    Is there any best practice on how to modify the plane anchors and the attached planes when working with the 2-camera scaling method described in https://blogs.unity3d.com/2017/11/16/dealing-with-scale-in-ar/? The only option I currently see is to scale plane and its position, because by just adjusting the positioning the planes will be too small, and without adjusting the position they appear on top of objects which are supposed to be in front of them. I guess the best approach would be to leave the anchor as it is, but instead of having the mesh renderer on the parent add it as a child, so we can scale the child and its position while the plane anchor position stays the same? Scaling the parent is cumbersome because every update will reset it to the original scale, and I guess re-scaling at every anchor update is not exactly the right approach.
     
  27. mlnczk

    mlnczk

    Joined:
    May 12, 2017
    Posts:
    10
    Hmm you guys got any idea how is arkit detecting exactly surfaces? What im trying to achieve is set raycast on camera and callback if in front of me a wall or just vertical surface I can work with or lets say some furniture, painting and stuff. I can't quite find it exactly where it is but im completely new to AR
     
  28. Ghus86

    Ghus86

    Joined:
    Oct 24, 2013
    Posts:
    12
    Hi
    In ARKit1.5
    How can I know if a image reference is visible by the user in order to play/ stop a video ?
    Thanks in advance
     
    Last edited: Apr 27, 2018
  29. atcjavad

    atcjavad

    Joined:
    Jan 8, 2018
    Posts:
    14
    Hi guys
    1.I wanna know how can increase the speed of plane detection ? Unfortunatly it is so slow.
    2.How can set up Arkit app on ios 10 or lower ? Because i wanna set a button on my app just for enabling ArKit Mode
    , any devises if there are ios 10 or lower , it gives them warning for checking their IOS version, it will guide them , what is their wrong.
     
  30. DanTaylor

    DanTaylor

    Joined:
    Jul 6, 2013
    Posts:
    70
    Hi there!
    I am having a little difficulty getting the light direction from ARKit.
    The code is pretty simple...
    Code (CSharp):
    1. if (camera.lightData.arDirectonalLightEstimate.primaryLightDirection != null)
    2.         {
    3.             mainLight.transform.localRotation = Quaternion.LookRotation(camera.lightData.arDirectonalLightEstimate.primaryLightDirection);
    4.         }
    But it crashes with a null reference exception.
    Am I missing anything obvious?
    Thanks.
     
  31. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
  32. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    Directional light estimate is only available in ARKit when using face tracking.
     
  33. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    1. Give the user hints on how to do plane detection - have them move the phone around, maybe follow an onscreen object etc.
    2. Use the
    ARKitWorldTrackingSessionConfiguration.IsSupported() method
     
    Burglecut likes this.
  34. DanTaylor

    DanTaylor

    Joined:
    Jul 6, 2013
    Posts:
    70
    Ah! Thanks! :D
     
  35. MSFX

    MSFX

    Joined:
    Sep 3, 2009
    Posts:
    111
    do you know which commit this was please? I assume this has been copied over to ARInterface as well? Working with Mapbox and they claim to have the latest ARInterface but this bug is still crashing my app on launch :(
     
  36. alamo88

    alamo88

    Joined:
    Jun 13, 2017
    Posts:
    1
    Hi, i have an GameObject created using the ARhittest, i have limit the creation to be within detected plane. My gameobject will move around, is it possible to restrict the movement to within the size of the current detected plane and delete GO when detected plane disappears?
    Thanks.
     
  37. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    826
    hi @jimmya any update?
     
  38. krosola

    krosola

    Joined:
    Oct 24, 2016
    Posts:
    10
    I am struggling to figure this question out, is there a native method that allows us to collect the position of feature points on a plane or not?

    arPlaneAnchor only stores one value, the anchor position of the plane, and you also have access to the the center position relative to the anchor position, but is it not possible to access the yellow feature points that lie on the plane?
     
  39. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
  40. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    ARKit uses the feature points to detect planes and probably stores the ones it used for a specific plane internally. But feature points are ephemeral (only the ones detected in this frame are enumerated), while planes are more persistent, so the planes do not expose this information currently. Also, the assumption is that anywhere on the plane you will hit a surface, so it is like an infinite number of feature points exist.
     
  41. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    Maybe not quite what you're looking for, but this is a project along those lines: https://github.com/johnsietsma/ARCameraLighting
     
    Last edited: May 9, 2018
  42. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    826
  43. shaundavies

    shaundavies

    Joined:
    Jan 31, 2017
    Posts:
    44
    Hi I was wondering how I could duplicate what the main camera sees without using render textures. I had solved this but lost the source file on how I did this. I remember how to mimic the film gate just not how to get what the phone camera sees onto more than one unity camera. I just get a green background.


    EDIT -- never mind the green screen is only shown in the remote connection and when I disable the unity camera showing the phones camera and re-enable it both unity cams show the phones cam in remote connection.
     
    Last edited: May 10, 2018
  44. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    See my earlier answer for context: https://forum.unity.com/threads/ark...nity-arkit-plugin.474385/page-53#post-3470141
    What this commit does is expose this boolean on face anchor - see https://developer.apple.com/documentation/arkit/artrackable

    So if you want to actually remove the anchor, you will need to call RemoveUserAnchor() with the id of the face anchor.
     
    Burglecut likes this.
  45. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    172
    I'm trying to get the ImageAnchor Example to work, but I can't. Images don't get recognized and I do not get any Logs on the ARKitImageAnchor Events.
    After digging deep, I saw that images.xcassets does not contain the AR Image target resources.
    What did I do wrong? Happens on an empty project, Unity 2018.1 and 2017.4.
    Could the problem be building on Windows Editor?

    upload_2018-5-11_18-29-26.png upload_2018-5-11_18-31-44.png
     
  46. jsanchezar

    jsanchezar

    Joined:
    Aug 15, 2017
    Posts:
    2
    Hi everyone,

    I want to use ARKit 1.5's image recognition in Unity and show something on the recognized image, but it always appear a couple of centimeters in front of the image.

    I will attach two screenshots, the first one is my goal wich I achieved using the Apple's example, it shows a plane on the recognized image. The second one is what I've done using Unity, it supposed to show a 3D Cube on the recognized image.

    Can someone help me with this?

    Thanks
     

    Attached Files:

  47. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    Yes the editor build post process script populates the asset catalog for XCode.
     
    Burglecut likes this.
  48. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    You need to check a number of things - check that the size you give for the reference image is accurate, and check that your gameObject is not offset from the origin.
     
  49. jsanchezar

    jsanchezar

    Joined:
    Aug 15, 2017
    Posts:
    2
    Thank you! I was using the Unity Logo image reference example and it comes with a size of 0.06 meters, but actually it's 0.1 meter.
     
  50. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    172
    Any chance to put this stuff in manually? Would hate to alway switch machine for building as it worked flawlessly for IOS projects (using IOS Build Enviroment) until now.