Spawning and Destroying an Actor

In this How-To guide, you will create your own Actor to spawn, and aActor Spawner which will spawn your Actor at the click of a button.

Choose your implementation method:

Blueprints

C++

Oftentimes in video games, players are kept engaged by attaining new items or weapons for their character, and sometimes new enemies may even appear for them to defeat.

In your game, you may wish to dynamically add items or enemies to your Level during gameplay, this is called spawning.

In this How-To guide, you will create an Actor class that will be spawned from an Actor spawner at the press of a button. Then, you will create the logic to destroy the spawned Actors at the press of a different button.

image alt text

[INCLUDE:making-interactive-experiences/interactive-framework/unreal-engine-actors/spawning-and-destroying-actors/spawning-and-destroying-an-actor-bp]
[INCLUDE:making-interactive-experiences/interactive-framework/unreal-engine-actors/spawning-and-destroying-actors/spawning-and-destroying-an-actor-cpp]
This page was written for a previous version of Unreal Engine and has not been updated for the current Unreal Engine 5.1 release.