How to make a mob spawner?

Hello everyone, I’m creating a mod in which you can put a mob spawner using the creation tool. But I had problems with their spawn, 25 seconds after they appeared in the world, they disappear (my way of creating them in 1 picture). I found a ready-made class ‘FgCreatureSpawner’ in the Blueprint class, but I could not get the mobs to appear in the way the developers intended.
From this I have 2 questions:
How can I make mobs stop despawning if I use my own method? and
How do I need to use ‘FgCreatureSpawner’ correctly?
Thanks in advance for your answers.


Hey my dude! I’ve made a mod icon for you but you aren’t on the Discord. join up and have a look in #art :wink:

Also: You’ll get promoted up, and have access to modder-only channels.

Hi, I’ve never really worked with Blueprints, but I have been a programmer for longer than I care to remember. As such, I think I have spotted your problem.
The main problem is that you’re not checking the return value from the spawner routine - If the spawner routine works, then you don’t need to go round the loop again. Currently you loop spawning continuously until (probably) unreal engine gets fed up and kills the routine. As part of it’s garbage cleaning up, it removes anything that your routine has created - hence the nodes disappear.

Ok, I wrote to you on discord

I don’t think the point is that unreal engine cleans the trash. After all, I have spawners without a loop. In addition, if you spawn buildings in a cycle, they do not disappear. But you gave me a very interesting idea. I will try to pull the mob directly from the game files and spawn it as a handcrafted structure.