I am trying to decrement an integer that keeps track of the number of enemies. The problem is, I cannot access this integer from the enemy character blueprint, and in the level blueprint, I am unable to get the ondestroyed() event for an enemy character.
How do I find the ondestroyed() event for a character? I already tried making a custom event and binding it to ondestroyed, and it works in the character blueprint, but not in the level blueprint.
For destroy, i don’t kow. But for “The problem is, I cannot access this integer from the enemy character blueprint”: i had a similar problem and i didn’t for the solution. I just do it another way. But i remember someone answered me that i need to make the int variable static (better do ti in c++ and make it available in blueprint). Someone else will answered you sood with the answer you are currently looking for. Good luck.
I simply kept an array of enemies in the game mode. The index of the array is the game level. The index would increment when all enemies of that level died. When an enemy died, it would first decrement the number of enemies in the level array. I hope this helped.