Download

Is it inefficient to add all particles my player pawn uses to its class?

My player pawn has some particles that it uses constantly, and others that toggle on and off conditionally. I have added the continuously emitting ones as a UParticleSystemComponent and I initialize them in the pawn’s constructor, then toggle them on/off during play as needed.

I have two particle systems on my pawn already plus I keep another reference to an emitter I spawn and play once on death. It’s all working and I was planning on adding more to my pawn in this fashion, but I wasn’t sure if keeping these particle references in memory all the time would end up becoming a problem at some point.

Also, do constant emitters each need their own ParticleSystemComponent if they will both need to play at the same time, or could I attach multiple emitters to the same ParticleSystemComponent?

I am no expert in UE but regarding the first part of your question (efficiency), I see no performance problem with your design as long as you turn off the emitters that are not currently used and that you don’t have hundreds of them (in such a case you would probably need to allocate them on demand). However in terms of construction it may benefit from some more modularity maybe using components.