Despawn monsters in Monster Spawner, which spawns multiple monsters at once.

I used Blueprints to create a Monster Spawner that spawns multiple monsters at once, then placed multiple Monster Spawners in the level.

The problem I’m currently facing is:

I’m trying to spawn 3 monsters each in Monster Spawner 1 and Monster Spawner 2. Then suppose that 2 monsters are despawned in Monster Spawner 1 and 1 monster is despawned in Monster Spawner 2. Then I want to respawn 2 monsters in Monster Spawner 1 and 1 monster in Monster Spawner 2.

Assuming I used the same monster and the same Monster Spawner, how can I figure out how many monsters were despawned for each spawner?

1 Like

You can put a variable on the monster BP, which lets it know which spawner was used.

That way, periodically, each spawner can take a look and check if all their monsters and still spawned. If not, make up the difference.

The variable can just be an int. Each spawner has an int ID, which you set in the level, and that ID gets set on the monsters.

thank you I’ll try it soon and let you know the results.

1 Like

hello.

I solved it by using the monster’s GUID.

  1. Store the monster’s GUID in the monster and monster spawner blueprint.
  2. When a monster despawns, get the GUID of the despawned monster from the monster spawner and remove it.

The solution was a bit different, but thanks for the inspiration.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.