Can't get anchor object from HitTestResult in ARKit

In 4.18preview 4, I never get Anchor object from HitTestAtScreenPosition_Tracking Space, even though ‘Existing Plane Using Extent’ selected and the result type of ‘Existing Plane Using Extent’ got.

Hello AstronX,

Is this a workflow that worked for you in 4.17 or in previous 4.18 Preview versions and it is just now occurring in 4.18 Preview 4 or is this your first time attempting this? From your picture, I’m assuming that the IsValid node is returning as “Is Not Valid”, so that the Print String is called instead of the Set node. Is that correct?

I have never got anchor object from HitTestAtScreenPosition function in 4.17 and 4.18 preview. HitTestAtScreenPosition cannot return an anchor object what ever I tried.

Instead, I’ve got an anchor object using session->GetAnchors blueprint function in 4.17, but that function disappeared in 4.18 preview.

I had found the problem in 4.17, and I have been waiting for someone solving that problem. But in 4.18p4 that problem is still there, so I reported yesterday.

I am not sure if it’s a bug.

astrongX,

We’ve encountered this issue as well. Have you found any work around?

Trying to jump from 4.17 to 4.18 …Same problem with accessing anchors…

Also seeing the same problem here. Anchor object retrieved from AppleARKitHitTestResult is not valid. Any progress on this?

Also encountering this problem in 4.18.2. Is there an ETA when this will be implemented? There doesn’t seem to be any way at all to access ARKit anchors, including the FAppleARKitSystem->GetAnchors() function.

Yes, I got the same problem here. Anchor object can’t be reached means cannot get its center point’s position either. Also is there a way to detect and visualize a plane before hitting the screen?

I am trying to achieve plane visualization as well, but it does not seem possible without making edits to the plugin/source to expose the anchors. This is not feasible for us as we are trying to avoid custom engine or creating our own flavor of the ARKit plugin.

Matthew,

I was poking around AppleARKitHitTestResult.h and AppleARKitHitTestResult.cpp, trying to see what it returns for the ARKitAnchor, and noticed this at the bottom of the header file for the declaration of the Anchor:

/**
 * The anchor that the hit-test intersected.
 * 
 * An anchor will only be provided for existing plane result types.
 */
UPROPERTY( BlueprintReadOnly, Category = "AppleARKitHitTestResult")
class UAppleARKitAnchor* Anchor = nullptr;

Pardon my potential complete ignorance, but isn’t this forcing the anchor to always return a null pointer?

UAppleARKitAnchor is a deprecated class. Sorry that it isn’t marked as deprecated. I added a Jira for myself to deprecate it and purge it later. The correct way to do this is: