Making a coin spawn out of another Actor once it's destroy in blueprints
Hey, I'm currently trying to make a coin spawn out of my barrel once the barrel is destroyed on contact with the player. The only issue I'm having is the coin get's destroyed with the barrel because of Overlap. Adding a delay right after DestroyActor and before SpawnActor doesn't spawn the coin.
asked Aug 02 '18 at 06:55 PM in Blueprint Scripting
This actor cannot execute any nodes after the Destroy has been called. Instead of destroying the barrel, hide it, disable its collision, spawn your coin, destroy the barrel.
That's the brute force approach.
The right way to do it is to set up object channels: https://docs.unrealengine.com/en-us/Engine/Physics/Collision/HowTo/AddCustomCollisionType
This way you can control which objects interact with one another.
answered Aug 02 '18 at 07:29 PM
The way I see it, it doesn't spawn after a delay probably because you feed the barrel location to the spawn location, and since the barrel doesn't exist anymore, the location is unknown. You should save the location into a variable before destroying the barrel. Another thing: your coin disappears because it instantly overlaps with the character, right? Try setting its initial collision to ignore pawn, spawn the coin right after the barrel is destroyed, and after a delay set the coin's Collision Response to Channel to Pawn -> Overlap. You will see the coin for some time before you can pick it up. Hope this helps.
answered Aug 02 '18 at 08:42 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here