I'm making a particle effect at the moment where when an enemy dies they spawn about 20 particles, and I want every one to move in a random direction.
The only way I can do this at the moment is to copy and paste this command 20 times:
effect(blood,1,vector(my.x,my.y,my.z),vector(random(40)-20,random(40)-20,5));
But, I would like to do something like this.
effect(blood,20,vector(my.x,my.y,my.z),vector(random(40)-20,random(40)-20,5));
This code spawns 20 particles with one command, but it only randomly generates an x velocity and y velocity once, so all those 20 particles move in the exact same direction.
I've messed around with the "blood" function that I have for the particles, trying to set vel_x and vel_y to a random number (which results in the particles spazzing out and moving in random directions every frame), and trying out other methods, but none have worked.
So, how do I spawn 20 particles with one line of code, and have every particle move in a different direction, without the direction changing every frame?
Thanks to anyone who tries to help. I'm a noob. :3