I am experiencing an issue in Unity AR where plotted objects are not aligning correctly with the detected ground level. The system should detect the ground plane using ARFoundation, but there seems to be a misalignment, causing objects to either float above or sink below the expected surface.
Currently, I am using ARPlaneManager to detect surfaces and raycasting to determine the correct placement height. However, the height calculation might be inaccurate, or the detected plane might not correspond correctly to the real-world ground.
Potential issues could include:
- Raycasting hitting unintended surfaces (e.g., other AR objects or transparent planes).
- Plane detection inaccuracies, especially on uneven surfaces.
- Incorrect calculations when setting the object’s Y-position relative to the detected plane.
I need a solution to ensure objects are consistently plotted at the correct ground level in AR. Any insights or alternative approaches would be helpful.