@J0hn @PatrickDevX When I add the panelEntity (added as attachment) via parentEntity.addChild(panelEntity, preservingWorldTransform: true) the panelEntity becomes visible but it's not tied to the parentEntity and keeps fixed when parentEntity moves in space. When I set preservingWorldTransform to false (which is addChild default setting) the panelEntity does not show up as before.
Post
Replies
Boosts
Views
Activity
@J0hn @PatrickDevX Sorry - all back! parentEntity.addChild(panelEntity, preservingWorldTransform: true) makes it work! This flag brings the attachment on screen and ties it to the parent!
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).