I tried using planes classifications, but it wasn’t working, is it officially supported?
Also, AR Raycast Manager is not compatible with Polyspatial, is there an alternative?
Hey there! Sorry to hear that you’re having trouble. AR Plane classifications are supported, and we show how to use them in the com.unity.polyspatial samples. You should be able to get them from ARPlane.classifications. What exactly isn’t working? If you build the PolySpatial samples and switch to the MixedReality scene, do you see the the planes annotated with valid classifications?
Unfortunately no. visionOS does not support AR raycasting. You can do a Physics.Raycast against AR Planes or Meshes with mesh colliders, but there’s no way to do an AR raycast on visionOS.
I haven’t tried the samples, but I tried using it myself. I created a plane prefab with a Mesh Collider and ARPlane component, I was raycasting onto it, using GetComponent to get the ARPlane class and was checking for Floors and WallsFaces, but it never was true.
Hm… that’s surprising. Can you share the C# code you’re using to do this, or submit a bug report (Help > Report a Bug...) with your project attached?
And to confirm some details:
- Are you testing on a Vision Pro device?
- What versions of Unity/PolySpatial packages are you using? Please specify down to the patch version (i.e. 6000.0.22f1, 2.0.4)
- What version of Xcode are you using to build the app?
- What version of visionOS is the device running?
- Is this app in PolySpatial or Metal mode?
- What classification do you see? Are they all
PlaneClassifications.None? - Are you using the
classificationorclassificationsproperty onARPlane?classificationhas been deprecated in AR Foundation 6 and may not return the correct value.
On my end, if I run the PolySpatial samples on device, I see walls, floor and ceiling. Some walls are identified as None, but I think that’s just because ARKit doesn’t know how to classify them. If you’re seeing every plane marked as None, that could be a bug, but you may just be seeing some inaccurately-classified planes. AFAIK the system tries to ensure that only one plane is marked as floor. Is it possible that you’re just looking at the wrong plane? Can you try printing a debug.log for each plane in OnTrackablesChanged on the ARPlaneManager?
It’s 6000.0.25f, Polyspatial 2.0.4, xcode 16.1, was testing on device with visionOS 2.0, RealityKit
I was calling GetComponent on a raycasted plane, then checking if classifications was equal to Floor or WallFace.
Will try the samples, when I have the chance.