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.
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.
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’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.
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.
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!