Preface, I am a noob.
Here’s my set up:
I have a widget on screen that displays a number. This number represents the number of throwing knives the player has. When the character presses ‘E’, it checks to make sure there is 1 or more knives in the counter, and if so it throws a knife.
I made a knife blueprint which has a collision box around the knife. On player overlap, the knife is added to an array. On end overlap, it is removed from the array.
In my character blueprint, when my character presses ‘F’, it checks to see if there is something in the array, and if so it adds +1 to the knife counter, and removes it from the array preventing the player from picking up more knives. The knife is still in the world though, so if the player leaves the knife’s collision box and reenters, they can then pick up another knife.
At this point, I want to delete the knife from the world. The only way I can figure out how to do it is to ‘Get all actors of class’ and then delete them. This is fine, unless there happen to be more than 1 knife in the world because it deletes all of them.
What can I do to delete that one specific knife from the world?