I have added an attachments closure in an RealityView as outlined in WWDC session "Enhance your spatial computing app with RealityKit" but it's not showing up - neither in Xcode preview window nor in Vision Pro simulator. I have used example code 1:1, however, I had to load the entity async with "try? await" to satisfy the compiler. Any help is appreciated, thx in advance!
Finally I got the solution (at least for my problem):
Let parentEntity be loaded to RealityView via make closure and panelEntity be included in the RealityView as attachment, e.g. representing a text label. Then you can either use
content.add(panelEntity)
to bring the attachment to live (as proposed by @J0hn), however, it's isolated and not tied to the parent. So if you want to link panel and parent (e.g. for automatically movement of the label with the parent) you need to use
parentEntity.addChild(panelEntity, preservingWorldTransform: true)
Here preservingWorldTransform was the key for me. Default setting is false and without this flag the panel was not shown on screen (at least in Xcode preview and Vision Pro simulator).