Add a blueprint to a blueprint.

I have 3 pickup items that I want to randomly be put into the map at a set time. Once they’re picked up, a timer will start again and then another random blueprint will appear.

I’m not sure how to do this. I have a base “spawner” blueprint and then a random int generator and a switch, but I can’t find a way to put the ammo, health or shield blueprints into the code.

UPDATE
I figured this out, but I can’t figure out how to detect when the pickup object is destroyed so I can start the timer. Is there a way to do that?

Two ways

  1. Spawn a timer actor. It’s just a blueprint that starts a delay. When the delay is up, spawn the ammo.

  2. The default blueprint has a timer in it. It only shows it’s contents after the timer expires. Before that, collision is off, and hidden in game.

How can I know when a user ran into the pickup item and it was destroyed so I can start a new timer event?

When the user picks it up, it spawns the new BP and kills itself :slight_smile:

I guess I’m not completely following. Won’t this create multiple pickups in the same pickup spawner?

I find a way. I have a child actor and I add the BP class to that child actor. Then on the timer, if that child actor has no children, it will spawn a new one. Not sure if this is the way to do it, but it works :slight_smile:

1 Like