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"

Why can I not spawn an actor after a delay?

I have created a blueprint called "EnemyCharacter" using the third person template. It follows the player and attacks them. However, I now want to make the enemy respawn after being killed. My logic for this is shown in the following screenshot.

alt text

After an enemy dies, it is destroyed using "DestroyActor". After a 1 second delay, "SpawnActor" is called to create a new enemy in the same position where the previous one died. However, the "SpawnActor" function fails to spawn a new enemy when the delay is used. If I remove the delay and go straight from "DestroyActor" to "SpawnActor", the enemy appears properly. Why does this happen and how can I allow the blueprint to use a delay properly?

Product Version: UE 4.10
Tags:
untitled.png (109.5 kB)
more ▼

asked Feb 01 '16 at 04:36 PM in Blueprint Scripting

avatar image

BenDaykin1
16 5 6 7

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

1 answer: sort voted first

you are destroying the BP (in this case your EnemyBP) that execute the Delay and the Spawn. That because never occur. When you destroy

You need do this in other BP, example a BP that control how many enemys in level...

Or spawn the actor before, hidde/deactivate it, activate delay in the new actor for unhidde /active and then destroy the old actor.

or other safe way...

more ▼

answered Feb 01 '16 at 05:03 PM

avatar image

knack
158 16 19 29

(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