Projectile Limiter/Counter

Hi friends! I hope you can help me.

I’ve these Blueprints:

1- Projectile 1

2- Projectile 2

3- Projectile 3

4- Pick Up Actor 1

5- Pick Up Actor 2 (similar to Pick Up Actor 1 - Pickup All is 2)

6- Pick Up Actor 3 (similar to Pick Up Actor 1 - Pickup All is 3)

7- Spawn Projectile (inside my Character Blueprint)

Thanks to “Pickup All” Int Variable, if I press Q when I’m near the “Pick Up Actor (2 or 3)”, my character spawn a “Projectile 1 (2 or 3)” every time I press “Left Mouse Button”.

Now I would make a “Projectile Limiter/Counter”, but I’ve tried for many hours without success with some variables, Branch, CompareInt, WhileLoop (crash everything LOL) and Gate nodes between “Left Mouse Button” and “Spawn Actor” and after “Spawn Actor”.

I think I need something that decrease my Projectiles when I spawn one of them and stop “Spawn Actor” when the counter is 0, but I don’t know how to do it.

Can you help me? :slight_smile: I’m sorry for my bad English :frowning:

Use “Do N” Node.

Hi Zeustiak, many thanks for your answer!

If I use “Do N” node between “Left Mouse Button” and “SpawnActor”, I’ve some problems with the exec “Reset” of “Do N” node. My solution is this:

Spawn Projectile (inside my Character Blueprint)

Pick Up Actor 1

Now I’ve a different “Do N” node with a different “Bullet Limiter” Integer variable for every Pick Up Actor/Projectile.

For example: “Pick Up Actor 1” give 10 “Projectile 1” to me through “Bullet Limiter 1”; “Pick Up Actor 2” give 20 “Projectile 2” to me through “Bullet Limiter 2”; “Pick Up Actor 3” give 30 “Projectile 3” to me through “Bullet Limiter 3”.

These BP are good, but I would know if many “Left Mouse Button” events can become a problem. Please, let me know.

Many thanks again for your support!