In UnityARHitTestExample.cs just change the following code
// prioritize reults types
ARHitTestResultType[] resultTypes = {
ARHitTestResultType.ARHitTestResultTypeExistingPlaneUsingExtent,
// if you want to use infinite planes use this:
//ARHitTestResultType.ARHitTestResultTypeExistingPlane,
ARHitTestResultType.ARHitTestResultTypeHorizontalPlane,
ARHitTestResultType.ARHitTestResultTypeFeaturePoint
};
To this
// prioritize reults types
ARHitTestResultType[] resultTypes = {
ARHitTestResultType.ARHitTestResultTypeExistingPlaneUsingExtent,
// if you want to use infinite planes use this:
//ARHitTestResultType.ARHitTestResultTypeExistingPlane,
//ARHitTestResultType.ARHitTestResultTypeHorizontalPlane,
//ARHitTestResultType.ARHitTestResultTypeFeaturePoint
};
For more info check https://developer.apple.com/documentation/arkit/arhittestresult.resulttype
ARHitTestResultTypeExistingPlaneUsingExtent
as an acceptable result ofHitTest
. It seems to be the most accurate type of hit result. – obywan