I’d like to spawn 1 ball. I got it to spawn balls however it creates a ball every time I press the K key.
So I figure I’d add a ball int variable and have it spawn the ball if it’s equal to one and have it destroy itself if it’s equal to anything other than that.
I’d do this by adding one to the balls variable every time the k key is pressed.
Here is what I got so far.
You need a variable that references your spawned actor.
After that, with every press check if variable has anything in it: if it does, destroy it and then spawn a new one. If not, just spawn and assign it to the variable.
You need to plug that variable to the destroy node or youll kill something else.