How do I destroy different actor each time I hit the same key
I have a scene with over 100 objects. I need to set the file up so when I hit a key the 1st actor is destroyed, when I hit the same key a 2nd time the 2nd actor is destroyed, etc.
Currently I have to set a different key/modifier for each object which works but is not very efficient. is there a better way to do this?
Any suggestions, greatly appreciated
asked May 03 '19 at 03:15 PM in Blueprint Scripting
You should put all your objects into an array. Then you can simply index the array and destroy each object. Starting with index 0, each time you press the button increment an integer variable that retrieves the array index from a "get" node. This way each button press adds 1 to the integer which will then retrieve the next object in the array and you can destroy the object after that.
answered May 03 '19 at 03:33 PM
Nebula Games Inc
Thanks, that worked great :)
answered May 04 '19 at 01:24 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here