The rendering order of UI in vision pro

How to make some label UI render to the front of 3D objects in the development of vision pro

Hi @yangchao12 ,

I'll need a little more information, but one of these two might help:

  • .offset(z) lets you set the z offset to render the label more forwards
  • setPosition can be used on RealityKit entities to change the z axis

Is this a SwiftUI label that is an attachment to a RealityView in an immersive space? Or is it a SwiftUI label in front of a Model3D view in a window?

The rendering order of UI in vision pro
 
 
Q