I’m having issues getting Collision Shapes working in Reality Composer on iPadOS, or with Reality Composer Pro via Xcode on macOS?
I’ve posted a video recorded through my Vision Pro showing the issue.
The project i’m working on is a Dice Rolling application. The dice don’t appear to be working set as Collision Shape=Automatic, which I assume takes into account the actual silhouette of the shape.
https://youtu.be/upPtQY4QOAk?si=yyx6rbSSmVkLxBLg
They also don’t rest on their face when they land.
Anyone experience this type of behavior and found a solution? I’m currently doing this with Reality Composer, but most likely will also be wanting to get it to work properly in Reality Composer Pro as well.
Thx!
From the documentation on Reality Composer, it reads:
Collision Shape. Used when RealityKit performs physics simulations on the object. Because physics calculations for complex shapes are computationally expensive, RealityKit uses a simplified shape like a box or sphere instead of the object’s actual shape when doing physics calculations. You can select Automatic to let RealityKit choose a collision shape, or you can manually select the shape that will give the behavior you want
In Reality Composer, the automatic mode will choose between one of these two representative shapes for you, but will not use the convex mesh itself.
To use a custom collision shape, you'd need to create your own ShapeResource from a given MeshResource. See https://developer.apple.com/documentation/realitykit/shaperesource/generateconvex(from:)-53jm9
and replace the CollisionComponent that Reality Composer puts on your object with the new one created from your custom shape.
See: https://developer.apple.com/documentation/realitykit/collisioncomponent
This requires some familiarity with the RealityKit API / Xcode / Swift