The ball goes through the ground in holo lens but in unity it works well.Spatial Mapping

Viewed 607

enter image description here

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.

enter image description here

enter image description here

enter image description here

2 Answers

From the image you share, Is Kinematic (in Rigidbody class) isn't enabled but above the image you tell it's selected to true. Leave it unselected and then the object will fall naturally with gravity. You don't need to do extra changes to the Rigidbody.

Also, assuming you don't have a hole in your floor, make sure you're placing a ball bouncing around after the spatial mapping is actually completed. If you're not giving enough time to create the meshes that represent the floor, then the ball falls through it.

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!

Related