x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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.

Product Version: UE 4.19
Tags:
more ▼

asked Aug 02 '18 at 06:55 PM in Blueprint Scripting

avatar image

Wildzx18
1

avatar image AZTECCO Aug 02 '18 at 07:23 PM

Hello! Please show us some graphs.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Adding a delay right after DestroyActor and before SpawnActor doesn't spawn the coin.

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.

more ▼

answered Aug 02 '18 at 07:29 PM

avatar image

Everynone
14.6k 76 25 61

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Aug 02 '18 at 08:42 PM

avatar image

Tuerer
1.8k 12 7 8

avatar image mightyenigma Aug 03 '18 at 08:25 PM

also delay nodes would execute after the object that is executing them doesnt exist anymore, so they would never continue.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question