Spawning an actor after the destruction of the same actor

Did you add the interface to the 3rd person character? Do you get that print string? Or does it actually spawn?

Hi everyone,

I’ll try to explain my problem as much as possible.

I’m very new to UE4 and i’m trying to create a simple game: You must collect Medic kit to regenarate your health, while taking constant damage.
I want those medic kits to spawn at random location in a defined Volume, just after the existing medic kit as been collected (Overlapped). So only one medic kit at a time.

I tryied using blue print Interface to do that, but either I dont understand how it works, or I didn’t used it well.
I am tringering a message from “Medic kit” saying that the ThirdPersonCharacter as overlapped it, send to SpawnVolume.

But it does not trigger. I actived my Interface into Medickit and Spawnvolume, but activeting it or not in ThirdPersonCharacter doesn’t change anything.
One Medickit is spawning at the begining as asked, is restoring Health and is destroyed when overlapped, but the respawning doesn’t work.

Please tell me if you need more info/pictures.
It’s been long hours I tryed to fixe it by myself, but now I need your knowledge :slight_smile:

i would personally take a more direct approach in this situation by having a variable on the medkit that is set to the actor that spawned it. basically in the medkit bp create a variable and make its type the same as the spawner blueprint in the details panel. also in the details panel set expose on spawn to true nad make the variable editable. the expose on spawn will create a pin on the spawn actor node so that you can set the variable when the actor is spawned, in this case we will set the variable via the spawn node and will set it to a reference to the spawner bp aka self (see pictures below). back in the medkit bp get the variable and drag off and search for the custom event you made, this will call the event on the spawnbp that spawned this medkit item.

this may seem a bit confusing but the basics are when a medkit is overlapped it calls the spawnactor function on the actor that spawned it. the event is called directly on one spawner so it makes things much simpler. let me know if this is to confusing and ill try to explain better

What do you mean you can’t “DO” the self node? You don’t know how or it won’t let you? To create a reference to “self” just drag off from the spawner pin and release in the editor somewhere so it pulls up the search menu and type in “self” you should see “create reference to self” somewhere in there

Hey Itried your methos but can’t do the Self node, the spawner is highlighted in red. any clues ? ( in your 2nd image)

Wow! Thanks it worked.

Any Ideas how to make this but spawn 1 bomb each 5 seconds to a maximum of 6 bombs and apply the same strategy that you shown ? when we pick a bomb another spawn after 5 sec,

also when you say the spawner is highlighted in red do you mean the spawn actor node or just the spawner pin? if its just the spawner pin then i would say that you have your variable set to bool. if the whole node has a red error on it then you didnt hook something up.

something like this should work

Wow! Thanks a lot. You’re really pro man !