Search Unity

ARKit support for iOS via Unity-ARKit-Plugin

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

  1. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    You will also need to make all the GameObjects (including the GeneratePlanes go) that have to do with ARKit to be "DontDestroyOnLoad". And please send logs or exact problem description instead of "it doesn't work".
     
  2. phits

    phits

    Joined:
    Aug 31, 2010
    Posts:
    41
    I am working with an animator and he is asking me, "How many frames per cycle?" for a AR character. Any suggestions?

    Thanks,

    Fitz
     
  3. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    484
    It depends on your App. You can target 30 fps or 60 fps. ARKit guarantees 60 video frames per second. This of course is completely app dependent. You need to consider your content, thermals, CPU/GPU load etc. Hope this helped.
    Cheers,
    Chris
     
  4. phits

    phits

    Joined:
    Aug 31, 2010
    Posts:
    41
    Thanks Chris!
     
  5. smallbit

    smallbit

    Joined:
    Oct 3, 2013
    Posts:
    54
    Last time I checked ARKit remote doesn't support touches, For testing purposes I used mousedown and just click in the editor instead.
     
    sama-van likes this.
  6. jkqs

    jkqs

    Joined:
    Mar 15, 2016
    Posts:
    13
    unity 5.6.3f1
    iphone 6sp ios11

    ARKit 1.0.8
     

    Attached Files:

  7. developersice

    developersice

    Joined:
    Nov 25, 2016
    Posts:
    36
  8. Carpet_Head

    Carpet_Head

    Joined:
    Nov 27, 2014
    Posts:
    118
    I'm having some trouble getting this to work and couldn't find anything earlier in the thread.

    I'm deploying the application to an actual device, and I am getting a pure green background rather than the video feed. ARKit is working, and i can see that it is tracking points and correctly tracking the location of the iPad, but for some reason the video is not coming through.

    I'm using the latest xcode, ios beta, and the arkit remote works just fine, including the video feed.

    EDIT: looks like metal rendering may be required
     
  9. JelmerV

    JelmerV

    Joined:
    Nov 29, 2012
    Posts:
    184
    I set my whole scene up as a child of an AR object that the user places, so that it doesn't matter where the camera is.
     
    KwahuNashoba and lnguy1948 like this.
  10. Bird_LYKKE

    Bird_LYKKE

    Joined:
    Jul 26, 2017
    Posts:
    15
    Xcode 9.0 Beta 6 (9M214v)

    build and run is fine but I got this message when Archive
    invalid iOS deployment version '-miphoneos-version-min=11.0', iOS 10 is the maximum deployment target for 32-bit targets

    And I already set Scripting Backend to IL2CPP.
    Do you have any idea?
     
  11. RubyKrongDev

    RubyKrongDev

    Joined:
    May 25, 2016
    Posts:
    16
    Forgive me for my English. It does not work, it means that I made OnDestroy before loading a new scene. But in the new scene, the Planes from the previous scene was still preserved.
     
  12. PdrMnts

    PdrMnts

    Joined:
    Dec 12, 2016
    Posts:
    13
    Does ARKit only works with a maximum of 30 of far clip plane? I discover where I can change the far clip plane in the editor (ARCameraManager script), where I should change to do it in the rest of devices??

    Found it. In ARCameraManager the m_session.SetCameraClipPlanes(near, far). :D

    TX
     
    Last edited: Aug 22, 2017
  13. oliver-jones

    oliver-jones

    Joined:
    Nov 8, 2010
    Posts:
    25
    This is not true. You can change the FarClipPlane (Clipping Planes > Far) on the camera within the scene via the Inspector to whatever you like. As long as you have the 'UnityARCameraNearFar' attached to that camera; it will update ARKit. Unless I'm misunderstanding your question?
     
  14. oliver-jones

    oliver-jones

    Joined:
    Nov 8, 2010
    Posts:
    25
    Does this occur with an empty iOS11 project? Doesn't seem like its directly related to using ARKit.
     
  15. PdrMnts

    PdrMnts

    Joined:
    Dec 12, 2016
    Posts:
    13

    Ups , that was my problem, I dint have attach it that script to the cameras as I started the project from scratch.

    thanks
     
    oliver-jones likes this.
  16. oliver-jones

    oliver-jones

    Joined:
    Nov 8, 2010
    Posts:
    25
    You may need to fully remove all ARKit components from your Unity project, and then do a fresh import again. Seems like you're using an old version of the plugin still
     
  17. oliver-jones

    oliver-jones

    Joined:
    Nov 8, 2010
    Posts:
    25
    I commented in your thread, Summary; try using Unity 2017.1.0p3
     
    developersice likes this.
  18. oliver-jones

    oliver-jones

    Joined:
    Nov 8, 2010
    Posts:
    25
    Have you tried passing this to your options when starting a Session?

    Code (CSharp):
    1. UnityARSessionRunOption options = new UnityARSessionRunOption();
    2. options = UnityARSessionRunOption.ARSessionRunOptionRemoveExistingAnchors | UnityARSessionRunOption.ARSessionRunOptionResetTracking;
    3. m_session.RunWithConfigAndOptions(config, options);
     
  19. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    484
    You need to update Xcode
     
  20. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    484
    Check your architecture settings in unity under player settings. You may not have universal or arm64 selected.
     
    DerekLerner likes this.
  21. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    484
    Yes, this is correct.
     
  22. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    484
    You need to either remove the game objects yourself, or write some code in the anchor manager to destroy them when the scene changes
     
  23. SkaZonic

    SkaZonic

    Joined:
    Jun 20, 2017
    Posts:
    23
    Hey @chr
    Hey @christophergoy, so I copied the code and in my scene I attached it to the tag, however as I don't want my tag to show at runtime but prefer to place it I unchecked the tag in the hierarchy (so it doesn't show) and when I build and run it on my phone the same thing happens, it disappears in less than a second of placing it. So is this to do with the ball maker script? Should I just create my own script? Thanks in advance.
     
  24. FlolF

    FlolF

    Joined:
    Nov 20, 2012
    Posts:
    11
    I got ARKit working before on iOS 11 beta 4 with XCode 9 beta 3 and Unity 2017.1.0f3.

    Since updating to iOS 11 beta 6 and XCode 9 beta 5, I can't initialize ARKit on scene start anymore. I also created a new project and did a fresh import of the ARKit plugin, does not work.

    - Anyone having similar issues or hints for a solution? I have to build on a remote mac, so can't provide any logs right now.
     
  25. oliver-jones

    oliver-jones

    Joined:
    Nov 8, 2010
    Posts:
    25
    Do you get any errors in your log? When you made a fresh project, did you download the latest version of the ARKit plugin from the Asset Store? (Quite possible that you're still importing an out-dated one).
     
  26. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    484
    Did you update your plugin code?
     
  27. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    484
    I think the only code you need I copy was from the answer. Not any of the other stuff. Just subtracting the two positions and calling lookAt. Just take a look at the answer and use that small bit of code
     
  28. SkaZonic

    SkaZonic

    Joined:
    Jun 20, 2017
    Posts:
    23
    Yep I know, I only used the code in the best answer however I want to place the tag and then have the tag always look at me not a tag thats already placed.
     
  29. Mr_Saboteur

    Mr_Saboteur

    Joined:
    Feb 2, 2016
    Posts:
    6
    Hi, first off, thanks to you guys for building and supporting this plugin, you're doing an awesome job so far. I was wondering if there is any plans on integrating Vision and CoreML framework as well. I think it would be an awesome addition as it could help us create more advance Mixed reality applications with target and object recognition.
     
    SkaZonic and FlolF like this.
  30. FlolF

    FlolF

    Joined:
    Nov 20, 2012
    Posts:
    11
    I use the updated plugin from the assetstore (1.0.8 - 16.08.2017). Also tried to pull the project from bitbucket (updated 21.08.2017) today.

    After the splash screen, the app should start UnityARKitScene, but I just get a blank blue camera screen.

    I can't access the log right now since I'm working on a remote mac. So I just build the project in Unity, create an .ipa in XCode and provide it as AdHoc app.
     
    Last edited: Aug 22, 2017
  31. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    484
    Make sure you set the camera usage description as well in the player settings
     
  32. dreamplanet

    dreamplanet

    Joined:
    Jun 17, 2017
    Posts:
    7
    JimmyA, Christopher - you guys are the best, thanks! You've answered a hundred questions for me in this forum already, but this is one that I haven't seen asked. I can place and scale objects fine but am struggling with scaling terrain for use on a tabletop. I can't scale it dynamically with a container as I can other objects. Terrain seems to just work differently - do I have to bake something to scale it properly? When I tap to align the world to a horizontal plane, I'm always standing within the terrain, rather than looking down on it, no matter how I try to scale it. I'm pretty new to Unity so this could be the stupidest question ever .. if so, I appreciate your patience. Thanks again!
     
  33. FlolF

    FlolF

    Joined:
    Nov 20, 2012
    Posts:
    11
    Thanks for the hint, I've double-checked.
    - Camera Usage description is set to "AR BABY". Even tried to change to "camera use".
    - Update from XCode 9 beta 5 to beta 6 didn't help either

    Could you guys give a hint with which versions of XCode beta, iOS beta and Unity3D you would recommend to work right now?
     
  34. jimmya

    jimmya

    Unity Technologies

    Joined:
    Nov 15, 2016
    Posts:
    793
    Another possibility is that you do not have a device that supports ARKit - you need a device with A9 or better cpu.
     
  35. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    484
    You could try the scale test branch on the bit bucket repo. https://bitbucket.org/Unity-Technologies/unity-arkit-plugin/branch/scaled-content-test

    Otherwise, I'm not sure. You can search the rest of the forums on how to scale terrain. Let me know how it goes.
    Cheers,
    Chris
     
  36. MaxXR

    MaxXR

    Joined:
    Jun 18, 2017
    Posts:
    67
    Thanks, does anyone know if it's possible that ARKit can support a fully integrated real time development flow – like what Google has for Daydream 27 mins in to the following? (i.e. at present ARkit plugin supports camera input but not gesture/touchscreen.

     
  37. jkqs

    jkqs

    Joined:
    Mar 15, 2016
    Posts:
    13
    My Xcode version is 9.0 beta
     
  38. jkqs

    jkqs

    Joined:
    Mar 15, 2016
    Posts:
    13
    I have built a new project to download the import in unity store, and there is no old plug-in
     
  39. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    779
    ARKit does not have this feature, but ARKit Remote which is built into the Unity package would probably provide what your asking here.
     
  40. Burglecut

    Burglecut

    Joined:
    Jun 27, 2015
    Posts:
    8
    It seems this solution to check if you hit a UI component is broken now, I can't place Objects on the planes anymore.
    Any ideas how to fix this?
    Same with the code below

    if (EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId)){
    return;
    }
     
  41. RumataM

    RumataM

    Joined:
    Nov 6, 2016
    Posts:
    15
    Hello!
    I can't launch the simple default Unity ARKit scene on my iPhone and receive no feedback anywhere on the web so far, so I would really appreciate some help, guys!

    After successful export from Unity, I'm opening the IOS package in XCode 9, and installing it on my iPhone (installation successful, though it asks me in the process to confirm that I "trust" myself as a developer).

    After that, if I click the play button in Xcode 9 again I see "Waiting for editor connection..." message on my iPhone screen and nothing happens. At the same time in the XCode I see multiple warnings and one error "UI API called from background thread", "UIApplication delegate must be used from main thread only".

    If I disconnect the iPhone from the computer and try to launch the app, it just crashes immediately.

    I use:
    Free Apple Developer account
    Unity 2017.1.Of3 (I tried also 5.6.1p1 and 5.6.2f1, the same result)
    ARKit plugin from Apple Store
    iPhone 7 Plus, IOS 11
    Xcode 9 Beta 6
    MacBook Pro (Mid 2015)

    Here are the screenshots of the process:









    I would really appreciate some help!
    Thank you very much in advance!
     
  42. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    484
    Which beta? They are up to beta 6 now. Please download it from the Apple developer website and try again.
     
  43. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    484
    Switch your scene to the UnityARKitScene and build again
     
  44. oliver-jones

    oliver-jones

    Joined:
    Nov 8, 2010
    Posts:
    25
    They released Beta-7 on the 21st. Just to let you know :)
     
  45. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    484
    That's iOS. Xcode is beta 6 ;)
     
    oliver-jones likes this.
  46. RumataM

    RumataM

    Joined:
    Nov 6, 2016
    Posts:
    15
    Ahaha)) That was so simple) Thank you very much! :)
     
    christophergoy likes this.
  47. pulteraoz

    pulteraoz

    Joined:
    Feb 13, 2017
    Posts:
    3
    Hey I am playing around with the AR-kit plugin. Everything is working perfectly. But I noticed one thing that I can not wrap my head around. When I build my app for the ipad pro (12.9' display) the camera video "stream" seems to by upscaled . Is the resolution of the ar-kit video some how capped to some max resolution (which is lower than the ipad's pro native res) ? Other devices (iphone 6s, iphone se) seem fine and the video is nice and sharp (whitout upscale).
     
  48. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    484
    If you search through this thread, you’d find many answers to this question. Please search next time. We are upscaling the texture to make it match the aspect ratio of the device, and this matches how ARKit is processing the texture for its vision algorithms.

    Again, please search the forum before asking questions that have been answered. It helps keep the thread clean of repeating questions.
    Cheers,
    Chris
     
    KwahuNashoba likes this.
  49. Scale1Portal

    Scale1Portal

    Joined:
    Jan 27, 2015
    Posts:
    17
    Has someone upgraded to XCode beta 6 & iOS 11 beta 7 ? Does it work with the plugin ?
     
    phits likes this.
  50. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    484
    Yes and yes
     
    sama-van and JelmerV like this.
unityunity