I have built a ball that bounces around my office. In unity it bounces perfectly but when I debug the project in the holo lens 2 the ball goes through the ground, it's as if I didn't recognize the ground. What scripts should I put to recognize my office well?
In the ball I have a "Rigidbody" with IsGravity true, and in the SpatialMapping I have the "IsKinetic" true.
First, be aware that when your application launches on the HoloLens it takes a few seconds for spatial mapping to initialize and for the surface mesh to be created in Unity. If your ball is already bouncing at the very beginning of the application launch, the surface mesh may not have been constructed yet.
Also, be aware that there can be holes in the spatial mesh. HoloLens does not always see black or highly reflective objects (like mirrors). You can use the Scene Understanding library to quickly make a "water tight" mesh of the room where there will be no holes.
Good luck!