How to add particles to a window, volume or space in VisionOS
For particle emitters created in Reality Composer Pro to work as expected, you must programmatically add them to the content of a RealityView.
The code for the demonstration detailed on this post can be found at the tutorials/reality-composer-pro/fire branch of our open source tutorial linked below.
The following demonstration attempts to solve the issue illustrated above, which arises if you use a Model3D to add a particle effect to a window or volume.
The issue becomes obvious when you move the window or volume and the particle doesn't behave as expected.
To solve this issue, you must programatically add the particle to the window or volume, using code similar to that above.
This will also render it correctly within a space.
Looking to learn more about SwiftUI, Swift, RealityKit, Design and Technology?
Search our blog to learn more about Swift, SwiftUI, RealityKit, design and technology.