Limit the number of placed actors on the level

Hi! is there any way to limit the number of placed of actors in the level? For example you can only place a Specific enemy per level.
Thank you!

Create a “director” class that manages the list of actors. Need one - ask the actor to spawn one, if it’s got room. When one dies, remove it from the list via the director. Simplest way that I do in my games.

And there is a way to make it via editor only? like a option or something?

I’m not sure what you mean by editor only. If you were to create an actor that accepts generic object types (other actors, ie) as an input, it can manage the collection for you. I use one specifically for mobs (monsters), one for triggers, etc.

With editor i mean something like this.

299110-ezgifcom-video-to-gif.gif

As you can see on the gif i can place many walls but is there a way to limit this?
Sorry for the confusion.

I see what you’re saying now. In the editor, I’m not aware of limiting static meshes without some C++ wizardry. You can, however, create wall actor objects and then manage them through globally to kill more than (x) # of instances. Even in the actor construction script, create a kill function if the # of instances is too high (this would tax the editor though, updating each time an actor of that type is “touched”), but if small enough a project, may work.

I will try! thank you!