ARMeshManager should support being disabled

How to reproduce :

  1. have a scene with an AR Session Origin and an ARMeshManager on it
  2. disable the game object
  3. press play
  4. you have an error because ARMeshManager must be on ARSessionOrigin => but it is !

Fixed it for you.

“Must be a child” means that ARMeshManager should be on a GameObject that is a child of ARSessionOrigin’s transform. But you place it on the same game object.

  • if you look at my screenshot, it does a GetComponentInParent line 174

the documentation says : “Retrieves the component of Type type in the GameObject or any of its parents”
with that in mind either the code is wrong, either the error message is wrong.

  • Placing the ARMeshManager on the SessionOrigin GameObject works perfectly
  • In this documentation it says : “All the trackable managers must be on the same GameObject as the AR Session”

With those information, I really think the error message is wrong AND that they should add a security to not display this message when the object is disabled. Please, correct me if I’m wrong.

It seems like it was fixed in AR Foundation 4.2.0-pre.7:
https://github.com/needle-mirror/com.unity.xr.arfoundation/commit/9d1caf96cd2efff14e3d66ae082c9b919b0cdb56#diff-463813eb57a6cf67e518089ac8aa2cca86e55c1876578fd5cbce29f88c2d21ff