Set Limit of Spawnable Object

So I have something in my game where I press “g” and glowsticks are thrown from the character. How would I set a limit on the number of spawnable glowsticks, so the character can’t just throw glowsticks infinitely?


  1. Create a variable
    2.Create a if there(variable>0) and bind to spawn actor node
    3.End of the spawn actor node decrease the variable by 1

so,
before the spawn actor node, if statement will control the variable and if is bigger than 0 executing the spawn actor node, then the variable will decrease 1.

1 Like

How wound I bind it?

called “branch” node

So about this.


(Then maybe add this to the back to reduce the amount?)

just – the glowstick variable after spawn it

That did it actually, thank you very much.

2 Likes