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 connect our DestroyAfter variable to the duration of Delay.Right-click on the graph and search for Spawn Emitter At Location. This node will spawn the given particle effect at the specified location and rotation. Connect Delay to this node and set a...