Cockroaches scatter when player gets near?

Hey all,

I’m trying to create a particle system with cockroaches and when the player gets near, they will scatter away.

I have the following particle system in place.
Spawn particles with no velocity.
When particles die, a new emmiter will spawn a new particle at it’s location that will run away.

I have very little knowledge when it comes to blueprints, so it might be something simple. But what I want now is that the spawned cockroaches will be killed when a player gets near.
However, I don’t want to kill the particle system, I just want it to continue running so that the second emmiter is activated.

After that, once the player gets far away, it will allow the system to restart it’s spawner.

Hey ,

Have you tried any methods with the blueprint system? My first suggestion would be to either use an event node for OnComponenetHit (CapsuleComponent) or to set up an OnActorBeginOverlap (PlayerCharacter) node within the blueprint system. Would you be able to show me what you’ve already tried to achieve this, or have you tried to achieve this as of yet?

Looking forward to hearing back from you, thanks!

Well, as I’ve mentioned I have little knowledge on blueprints.
I haven’t tried to create the collision event yet as it shouldn’t be hard to create a trigger and it’s more difficuld to test as it would require me to move around after every change.

So I tried to create the event first that would kill my particles that are alive so that the second emmiter could be activated.
I tried to test this with a delay on event tick and several iterations that would make sence.
But it usually just shuts down the entire particle system or do nothing at all.

Besides that, it might be that I take a completly wrong approach on this all together.

Hey ,

I have compiled a blueprint for you which I believe is what you want to happen. With this blueprint layout, you’ll have a trigger box where a particle effect will happen, but when you leave that area, something else will happen. So the way I have it set up is to have an explosion, including sound and to deactivate the explosion particle effect once it’s done. This should give you the grounds to create what you’re looking for with the cockroaches scattering.

I did attempt to use a collision in the beginning however it didn’t respond the way that I thought it should for what you’re requesting. Please let me know if you have any further questions.

Have a great day! :slight_smile:

Hey, I’d like to thank you a lot for building this blueprint. But as I’ve mentioned, it isn’t about building the trigger. It’s more on creating a blueprint that kills the particles from one emmiter so that the other emmiter will occur.

However, I was just able to solve it and it’s actually rather simple. I just took a completly wrong approach.

I added a blueprint node generate particle event. give it a name.
Then on the emmiter that I want to have killed, create an event reciever kill all module that kills all particles when the blueprint node is activated.