I tried to integrate this plugin into my existing project which require OpenGL 2 to render the screen (legacy reason). If I simply put the plugin in, the plugin is able to run the world recognition, but the camera image does not render into the scene. I guess that’s because I was using OpenGL as the render API, but this plugin send the image to metal API.
Is there another way to enable OpenGL2 rendering on this plugin?
You cant. ARKit does not support image based tracking. If you would like to do this then you would be better off using something like Vuforia to handle the tracking.
The differences between the two are:
ARKit uses VIA (Visual Inertial Odometry) to track an environment. It analyses the camera frames and combines this with the sensors on the device to provide robust tracking.
Vuforia uses natural feature tracking to recognise an image and track its location. Once the image is out of view however the tracking is then lost.
You could combine the two, so you can initiate your experience using Vuforia and then switch to ARKit, but you may get some flicker or a stop/start between the two camera systems.
Does anybody knows how to detect if the camera is detecting a plane or not? currently i’m working just with horizontal planes but sometime the camera is not detecting any planes so i would like to tell the user whether they can touch the screen or not to instantiate an object. Thanks!
You can check the tracking state to see if its valid or not (UnityARTrackingState). You can also check the tracking state reason to warn your users of any issues with tracking (https://developer.apple.com/documentation/arkit/arcamera.trackingstatereason). For planes I would check the
UnityARAnchorManager to see if any planes are being tracked.
Thanks for you reply! I just need like bool variable that tells me if im hable to place an object or not, i have been trying to figure out with UnityARAnchorManager but did not succed. Wher do you think i can get if a plane is being detected?
Just started checking out the Unity ARkit plugin. Got a couple questions. I was a user of Vuforia before this and it worked quite well but not as robust as the tracking in the new Apple AR API. I have imported a couple legacy characters in my ARkit scene which seem to drift nonstop forward even though I have the ‘Foot IK’ checkmarked in the animator. My humanoid characters do animate properly but I can’t seem to figure out where the drift is coming from? Any ideas? Also - the Camera Parent should probably be 0’ed out in the pos & rot but is it okay to tweak the translation and rotation of the Child Main Camera? The characters always start in the wrong place and in the wrong rotation. Is there a way to make sure a gameobject can appear exactly at the scale, rotation or position when the AR XP starts? Trying to figure this out but there isn’t much data or tutorials out there yet for obvious reasons. Any help or advice would be greatly appreciated!
Thanks in advance.
There are some resources in the README.md, TUTORIAL.txt and SCENES.txt files in the project. There are also a few tutorial videos linked in posts in this forum. As mentioned, you should try and understand how ARKit works to begin with, then see how the plugin projects implement some of the functionality.
The main camera in the scene is not something you move around, but it gets set to 0,0,0 when you begin the session, and when you move the device around, it controls the movement of that camera. You should place the gameobjects you want in the world, and not as children of the camera.
I really apreciate your reply but what i’m looking for is to know before the user taps on the screen if there is an available plane as it is shown in this Demo. i’ve been trying with UnityARSessionNativeInterface.ARAnchorAddedEvent but did not find any result to what im looking for.
You don’t have to wait for user to tap to do HitTest - keep doing a HitTest on the center of the screen every frame, and update the “focus” square based on the result (they solidify it when they have found a suitable plane under the center of the screen).
BTW, the ARAnchorAddedEvent should also work. You can have it trigger and generate an object at the center of the plane it has found (it will work differently from the hittest above, since the center of the plane found could be offscreen). This is exactly what we do with UnityAnchorManager.