Stopping projectiles from going through walls

Hello.
I’m trying to create a blaster (actually a plasma gun). I want it to be stopped, but only by walls because I want it to penetrate enemies. I could just use Event Hit and Destroy Actor, but 1. For some reason it doesn’t work and 2. The visual element of the projectile is Particle System (modified P_Sparks from Starter Content) that leaves trail and when I destroy it, the trail just disappears.
How do I do that?
BTW. If you need any screenshots or additional information, tell me.
Thanks!

You can create custom object/trace channels in the project settings. Make a custom object channel and set the projectile to that, then have your walls block it, but not your pawns.

Ok, I created the Object Channel, but now how do I edit wall’s collision?

Collision settings. Change collision preset to custom and set it to block your new object channel

Ok, nevermind it worked, but now there is this problem with particles. When I destroy the projectile, particles just awkwardly disappear. Is there a way to fix this?

Don’t know much about particles, but I’m sure you will have to change the particle to disappear over time instead of destroying it. I wouldn’t know how to do that, but I’m sure there’s some particles put out my Epic that do just that and you can check those out and copy them

If you have the rest I will leave you to it.

For the particle trails - have you tried checking Kill on Deactivate on the [Required] section?

There are a couple of ways to do this.

Instead of destroying the projectile, you can destroy the static mesh, and destroy other components individually, and then destroy your particle after a delay. Try destroying just the static mesh on impact.

Another way is to create a separate blueprint that only contains your particle effect, and give it its own duration before being destroyed (don’t try just spawning particle systems outside of blueprints–they can persist and eat CPU, even after they are done making particles). Then you can spawn the blueprint at the location where the projectile impacts, or spawn it alongside the projectile with the same velocity.

Hope this helped, good luck!

What if I just used Deactivate (Particle System) and Set Collision Enabled of my sphere collision to NoCollision instead of DestroyActor? Is that a good solution? I tested it and particles don’t disappear, and the projectile cannot kill an enemy behind a wall.