Destroying our Blueprint Actor after some seconds
Once we place or spawn this Actor in world we will destroy this actor with a particle effect and sound. To do that:
- Create a new variable (
float) and name it DestroyAfter. Let's give it a default value of five seconds.
- Go to Event Graph and add a new event called Event BeginPlay. This node is immediately executed when the game starts or when the actor is spawned in the game.
- Right-click on the graph editor and search for Delay and add it. Connect Event BeginPlay to the Delay node. This node is used to call an action after a number of specified seconds.
- The Delay node takes a
float value, which is used for the duration. After the duration runs out, execution is continued to the next action. We will ...