How do I reference my particle system in code?
In the tutorial for Variables, timers and, events near the end, you are shown how to create a particle emitter via Blueprint. I was curious about how to achieve this through code as opposed to Blueprints. I have checked out the Particle systems documentation but am unsure of how to reference the starter content "P_Explosion" in my code. Any direction would be much appreciated.
asked Nov 02 '15 at 08:12 PM in C++ Programming
Direct references to assets in C++ code should be avoided. It's better to declare particle system component in your header file like this:
Then create it in your constructor:
And then set it's template in editor.
If you still need a reference to particle system, you can get it like this:
Hope this helps.
answered Nov 03 '15 at 04:49 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here