DepthKit in iOS

I tried adding a depth kit scene to vuforia on Unity and it works perfectly when I play the scene on unity. When I built the scene into an iOS app, the app works in iOS and the DepthKit object is shown too however the object’s animation (video) doesn’t show up. Could someone help with this please?

1 Like

Okay, I made it work.

Just in case if someone is trying to figure this out, feel free to reach me out.

1 Like

Hey Asif,

Glad you got it working! Would you be willing to post how you fixed it here for others to benefit? Thanks!

In my case, at the beginning I added the ARCamera then added the image target then added the DepthKit object to the image target.

This is how the hierarchy looked like:

Now this would perfectly work if you run the scene on Unity. However once we built this project for iOS and then built the iOS app on Xcode then run the app on your iOS device, the DepthKit Object would show up in the app but the object wouldn’t move (animation/video doesn’t work).

There is a quick fix for this. Instead of adding the DepthKit object directly to the image target, add a video player to the image target then add the DepthKit Object to the video player.

This is how the hierarchy should look like:

Pardon me for posting this as two threads, users could only post one picture per thread.

Thanks for this @AsifRasheed! I’ve noticed this in ARKit as well. What we do (and what seems to be standard for ARKit development) is to place the Depthkit clip as the child of a GameObject called something like “Depthkit Parent”. Then for placing ARKit objects, we place the Parent object instead of the Depthkit clip directly, so the parent moves and updates but the Depthkit clip stays in the right place in relation to the parent.

I’ve seen people do similar things as well for VR controllers, where a controller updates the parent of an object instead of an object itself.

Glad you found a solution!