I'm trying to limit the amount of a specific actor that can be on the screen at the same time. To give an example, I'm working on a game where I have actors continuously spawning every few seconds just offscreen and moving towards the player. I want to be able to limit the amount of these actors that can be alive at once so that the game does not lag, and because too many of these actors can make the game difficult as well.
I was trying to use an attribute that was increased by one each time of these actors is spawned, and checking that the attribute is less than an attribute that is defined as the maximum amount of allowed actors.
I cannot figure out how to get this to work easily, and I feel like I'm missing something simple. The behavior I scripted for this is a scene behavior, and the behavior that broadcasts the actor's death is an actor behavior. I can't seem to get them to hear messages from one another, unless I'm doing something wrong.