Add Particle System Componet Function in BP not working using input variable

I have a blueprint and in that blueprint I have a variable that is a Particle System reference. Its a beam particle system (but the issues seems to happen with non beam systems as well). I have set its default value to a particle system and dragged out a pin and called the function “Add Particle System Component”. The beam particle system hooks up to the “Component Template Context”. Unfortunately this doesn’t seem to create the particle system at runtime and throws a few thousand errors in the log all saying “Error Accessed None ‘Content’ from node Add Child Actor Component in blueprint …”

I have created a small example of the issue and attached an image.

Try using the Add Particle System Component node as in the green example – then route that created component into a Set Template node to set the particle system template.

I don’t know why the template context doesn’t work – that input node isn’t documented and it would seem like it should do the same thing.

Hey Kurtrussellfanclub. That works! seems a bit odd but works. I am wondering if I should leave this open so Epic knows it is still an issue (though one that can be worked around.

This is funny because I am pretty sure I tried setting the template using the node after construction and it didn’t work. The only thing I can think of that was different was that I was using the method in red and not the one in green.

For anyone curious what this might look like in templates I have attached a BP that shows what Kurtrussellfanclub is suggesting.

Hi BlueByLiquid -

kurtrussellfanclub’s setup is a correct functionality, I prefer to use the spawn emitter setup, but both are just as correct depending on circumstances. As far as the issue with the Context Component Template, I have entered that as a bug, for reference UE-14914. Since there are two workarounds to achieve the same results I suspect that the issue will be backlogged, but I will keep you informed here.

Thank You

Eric Ketchum

Hi there!

In the example given in the original post, the area colored in red is actually a bug - the ‘ComponentTemplateContext’ parameter is meant for internal use only and as such is not supposed to be a candidate for automatic connection when dragging off of the BeamParticleSystem variable. (Specifically, the ‘ComponentTemplateContext’ parameter internally holds a reference to the Blueprint Class itself in order to provide context for where the component template can be found at runtime). That issue has since been corrected (such that you will no longer be able to choose the AddParticleSystemComponent node in the context menu when dragging off the variable), but in the current release, as you note, making that connection to an existing ParticleSystemComponent reference will fail to instance a copy.

FWIW, components added in the Construction Script aren’t meant to be initialized from an external template. Instead, the template is stored along with the node and can be edited directly via the Details view when the AddComponent node is selected.

Hope this helps!

(For reference, the situation highlighted by the area in red should no longer be possible after change # 2606203 in the Epic Perforce depot, which you can also review/obtain through GitHub at https://github.com/EpicGames/UnrealEngine/commit/f864e2455c4eca43023c410edeee5299c6e0541d)