I am trying to limit the number of balls being thrown by my character so I don’t have more than 5 on the screen at one and I can’t figure it out. I managed to set an integer for how many balls have been spawned and when it gets to 5 it will delay the spawn and reset the number back to 0. But it only slows how they are spawned and does not allow me to shoot up to five again. I read also that I need to decrease my projectile count when they are destroyed but I am not sure how to reference the int variable because they are in two different places.
When your ball is destroyed cast to the BP that is shooting the balls, I am guessing you are using FirstPersonCharacter. After you cast to the FirstPersonCharacter blueprint get the variable you need to alter, subtract 1, set it, then destroy the ball.
Hi man ,
When you try to shoot, ad an “if” and use the node “get all actor of class” , “ball” <5.
So only when you try to spawn a sphere, you check for how many balls there are in the game already , and if they are <5 he spawn it.
So you dont have to put on variables and keep track of the number yourself.
its really really hard understand how do something and why do it in that way.
This is not the perfect solution for every time.
Its almost all to you, learn+think+try .