Spawn multiple projectile inside a BP, HOW?

Hello VFX community :heart: .
what i’m about to show you is a vfx i made lately:
out (11)
I basically worked on this project with the idea of ​​applying what I’d learned from Niagara Modules, and in that case, I succeeded.
But even before that, I wanted to try something else: preparing it as if I were going to use it in a video game.
So, I’ll lay it out: I suck at blueprints, I’m horrible, disgusting, terrible. That said, I tried anyway.

(First Problem): Collision Box
The first problem that plagued me was box collision. Lately, I’ve always been working with single projectiles, so when I spawned the Niagara within the blueprint, I just had to add a collision box. But here, the Niagara spawned multiple projectiles, it moves randomly and everything. Was there a way to apply collision to multiple projectiles spawning at the same time?

(Second Problem): Give the niagara VFX a target
That’s why I watched two videos about it:
The first was to apply projectile movement within the VFX (which apparently, I think, is used for almost all projectile VFX) and set homing to true, but this wouldn’t work because there were multiple projectiles (I even tried, but it almost burned my computer, lol).
The second was him using spring force and creating a variable that he then looked at within the blueprint, this creating a target. But the problem with this is that I didn’t like how it immediately reacted to the target and chased it. So I thought about using the point attraction force and creating a variable as the target that I would later call within the blueprint, but that… didn’t work, so like a good person I gave up and changed the offset of the point attraction force within the world so that it looked like it was chasing the ball, but I just placed a mesh on top and increased the kill sphere so that it looked like it had collisions :slightly_smiling_face:. Yeah, i know, i sucks.
Video i meant with the spring force ( https://www.youtube.com/watch?v=cKwG9BZGyko&list=PLCggMVYqnCPI4oKOTqZZJ-rqHTZ5ott7j&index=4 )

SOOOOOOOO this isn’t a huge request for help, but it was more about understanding how I could go about it, so I can fix it in the future when I need it. I even tried Unreal documentation and everything, but I couldn’t find anything, and after four days of my head spinning, I made sure it was more of a visual thing than a practical one. So, big VFX community, mostly those who know this technical stuff much better than me (even a child would know more than me) I ask, how could I have approached all this?

I think the key thing here is understanding what’s gameplay-related and what’s visual-only. Niagara should only handle the visuals, while anything that has to do with gameplay logic is handled in BP.

So in the example of spawning multiple projectiles, you need to ask yourself if these projectiles are visual-only or if they impact gameplay. In other cases you might be spawning projectiles that just do a cute swirl or whatever to represent a buff or something… but in this case it’s definitely gameplay-related. I’m guessing each projectile will collide and deal damage individually, right? So each projectile will be an exclusive actor in the world. Your Niagara system should be representing a single projectile, and shouldn’t move on it’s own. Movement and collision are handled in Blueprint, and you spawn N of such BPs for each projectile you fire.

For just a couple projectiles it might be fine, but it’s reasonable to be concerned about performance if you’re spawning dozens and dozens of them. If it ever came to that, you could handle all N projectiles in a single BP and do some optimizations for collision - for example, you dont really need an actual collider unless it’s a very dynamic skillshot ability that can be dodged or can collide with the environment and be destroyed. No need for that in your case I think - you just check if the projectile got close enough to the target in your projectile movement logic and that’s a collision. Similarly, spawning too many Niagara systems is expensive. Instead, you could use a single Niagara system and just have BP feed it an array with the positions (and other data you need) of each of the projectiles. Anyway, it can get more complicated in those cases, and honestly I haven’t needed this kind of approach myself so I’m not even sure if I’m right in what I’m suggesting here.

I personally write all movement logic myself, but Unreal has built-in projectile movement functionality. I can’t comment on how good or bad it is, but if you’re not comfortable with programming that’s definitely a valid option.

Cheers!

1 Like

Thank you really much for the reply and the advice man.Yeah, one day i want to make the blueprint by myself, the problem is i can’t get used to the blueprint interface (for now), now I’m slowly starting to create shaders on my own, I’ve learned to interface better and I’ll try to do the same with blueprints lol. Thanks again