Is There A Way To Update A Single Particle's Location In A Niagara System?

Hi, I have been trying to hack my way around spawning hundreds of enemies on screen without impacting too much performance and Im now experimenting with Niagara’s Skeletal Mesh Component to see if it can boost performance even more.
So I have 50 empty pawns scattered and Im also spawning 50 zombies in the niagara system.

So what I want to do is provide an array of vectors to tell each particle to spawn in the empty pawns that I have scattered.

I have tried multiple stuff but I got mentally exhausted after trying this for multiple days.

Any help would be appreciated!

2 Likes

Perhaps there is a way to do it with the execution index on the scratch pad?
I tried feeding multiple vectors into the particle position but the zombies always spawned on 0.0.0.0 so perhaps Im doing something wrong.

I think you can do it that way. So the scratch pad could have a problem. May I see the graph?

1 Like

For sure!
The niagara graph is pretty simple. I made a scratchpad and added it to the Particle Update.

Inside the scratch pad I made a variable called Scratchpad Array and binded it to my User parameter called ZombieLocations which is a vector array which I set on tick from a blueprint.
The scatchpad graph:

I hope this is how you bind parameters inside a niagara system.

The user parameter is receiving the values well but when it gets inside the scratchpad it reads everything as 0.0.0.0

1 Like

I’ve had the same method for the scratch pad and worked fine. So I think the problem may exist outside there.

Firstly, are you using the “Niagara Set Position Array” Node in the blueprint? if so, the input TArray must have the same number of elements as the particles in the emitter (if with that scratch pad implementation).

It seems you utilize “Spawn Rate” and it may increase number of the particle through a cycle. Please make sure the number of elements is in sync with the blueprint and the emitter.

1 Like

Im using Niagara Set Vector Array on the blueprint, then on the scratchpad I transform the vector into a position.


Im feeding my player position for debugging and to see if they spawn directly on me.

Then I just print the user vector parameter that is inside the Niagara System to make sure it passed through, which it did, my player location is being printed correctly from the user variable inside the niagara system.

Now I switched spawn rate to Spawn Burst Instantaneous, Im spawning 1 each second and killing 1 each second to make sure it only has 1 zombie for each array entry.


As you can see he is at 0.0.0.0, I walked around and he did not spawn on me

My brother in christ, forget it, I may have messed up the settings of my skeletal mesh renderer when I created it.
The relative location in my skeletal mesh renderer was not set to Particles.Position, so it wasnt reading from the vectors I was giving him at all, therefore was spawning everything at 0.0.0 by default. GG Im thankful for your time!

That’s good to hear.

By the way, you might want to move “Read Positions” under “Particle State” which has “Kill Particles”, just in case.

1 Like

Did as you said, just in case!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.