I am trying to make an application for the Vision Pro where the particles don't move but rather stay still so that there is no lag. For example I am trying to spawn in a 100 particles here:
I want the particles to remain static but spawning in many causes the simulator to lag. Also is there maybe a way i can get a particle system to follow a specific shape like the one i have in the image.
Currently, I have multiple model entities that take on a particle system component
for i in 0..<100 {
let newEntity = ModelEntity()
var particleSystem = particleSystem(color: newColor)
newEntity.components.set(particleSystem)
newEntity.position = position
newEntity.scale = scale
stars.append(newEntity)
}
}
func particleSystem(color: UIColor) -> ParticleEmitterComponent {
var particles = ParticleEmitterComponent()
particles.emitterShapeSize = .init(repeating: 0.02)
// make burst smaller
particles.emitterShape = .sphere
particles.mainEmitter.birthRate = 1
particles.mainEmitter.lifeSpan = 2
particles.mainEmitter.size = 0.02
particles.burstCount = 50
particles.speed = 0.01
particles.mainEmitter.isLightingEnabled = false
particles.mainEmitter.color = .constant(.single(color))
return particles
}