Hi, first post to the forums so i hope i’m not doing anything wrong. If i am, you can take the correct actions or let me know.
My question is regarding the video of unreal engine ‘Simulating large crowds in unreal engine’ → niagara system with vertex animations.
I have been trying to get that system to work in my game but allot of the system is skimmed over and it is very hard to manipulate it in the way that the presenter is doing it.
What i have been able to reproduce is:
-setting up Niagara system - with certain scratch pads
-Vertex animations
-Manipulating certain vertex animations f.e. changing animation etc.
-Blueprint interaction with niagara → getting position velocity of the particles
-User parameters to interact between niagara and blueprint
But i cannot seem to figure out how one would calculate the position of a projectile or a sword of your character to when it hits the particle system (hits = particles calculate the position of the sword/projectile and position of themselves), let that particle system interact with that hit (= get thrown back, spawn blood at that location etc.) and make instances of particles dissapear/be replaced by dead meshes and keeping track of that.
In short:
-How to calculate particle position and player position so it can interact with each other
-How to remove particles when interacted with + do certain events like spawn blood
other aspects of the video but it may be too much to explain
If someone could get me in the right direction (f.e. tutorials because they are very hard to find regarding this topic) or can share some wisdom. that would be much appreciated
You would need to do all the calculation inside the Niagara system. For example, send the character’s sword position into the particle simulation as user parameter, then each particle compares its own position to the sword position and if they are close enough the particle kills itself or changes state to go into “dead” mode or something like that.
First of all, thanks for replying to my question MGaletzka
Secondly, i went down a rabbithole in trying to find this and debugging it.
Sadly i came to the conclusion that my knowledge of scratch pads is still lacking wich made it very difficult to debug.
I did however find a different way to make specific particles die on overlap with an object.
For people who are wondering how they would do it is as follows:
-Make a new collision object channel in project setting (f.e. swordcollision)
-Set the niagara collision to CPU and set the collision channel to the one you just made (found at the bottom of the list) → also enable block that channel on your sword in charbp.
-Enable the blueprint interaction to niagara → Callback Object (= particle data event in bp)
With this you will get the collision and positions of your particles.
-In the blueprint where you have niagara set the particle data (only collides and enables with the object collision channel that you made previously)
-In Nia System, create a kill particles in volume at the particle update → set the volume origin to a user parameter (f.e. sword location vector)
-When particle data activates = particles are colliding with something → cast to your character BP and get the location of your sword. Set the user parameter vector to the one you just made = Sword Location.
Your sword location from your charbp is obviously the input for that niagara variable vector SworLocation parameter.
I hope i’m explaining this in a way that people can understand. In short, this lets the particle system know when it is colliding with your object channel (sword) and if so we will kill that specific particle.