How to only spawn particles if its attached actor is moving?

I’ve a dash effect and my dash has iframes. The iframes can last longer than the dash at times (e.g. dash into a wall), which is fine and my desired effect but the particles spawn even when standing still and look a bit goofy. Is there a way to sample against the actor velocity so it only spawns particles when the attached actor is actually moving?

Hi @Krileon, you probably want to do this within your blueprint by destroying the system when the dash is interrupted, though you can do it within your particle system if you need to.

In the spawn rate module, you can set the spawn rate up to a custom bool.

From here, you can go ahead and make a scratch pad to control the bool state.

Here, you can take the owner’s velocity as an input. I’ve added and abs node so all values are positive. Then, you can compare the velocity against your minimum velocity to start the particles, and if your return bool is true, particles will spawn.

This will still produce particles if your player is above a threshold velocity, even outside of the dash. If needed, you can add a Do Once node to make sure there is only one switch between the two states.

2 Likes

Ah, that’s smart! Works for my needs, thank you!

Oh, as for why I’m not destroying it when the dash is interrupted is I want the player to continue to have their iframes. It’s like a buff. So no matter what they still get x amount of iframes even if they hit a wall. The particle effect helps visually let them know they still have iframes, but otherwise yeah I’d just destroy it.

1 Like